Computing.Net > Forums > Programming > Batch - typing a story

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch - typing a story

Reply to Message Icon

Name: rjone187
Date: March 23, 2009 at 18:38:23 Pacific
OS: Windows XP sp2
CPU/Ram: -
Product: Intel / -
Subcategory: Batch
Comment:

Hello all.

Ok i have made a batch that will help me make a batch story. But after i type a few words and press enter it closes and does not store what i type. Any help on how to make it work will be great.

this is what i have so far.

@ECHO OFF
Echo Name of Story?
set story=%~f1
if not exist "%story%" set /p story=
echo %story% >> %story%.txt

:Info
cls
echo Info
echo Press a button and then press
echo enter for the effect.
echo ---------------------------
echo echo ---- is 1
echo echo %%name%%: is 2
echo echo %%Girl%%: is 3
echo echo %%Namefriend%%: is 4
echo echo %%Nametown%%: is 5
echo ---------------------------
Echo Press 1 and 2 to get (12)
echo echo ----
echo echo %%name%%:
echo ______________________________
pause
:Type
cls
set %cho%=type
echo echo %type% >> %story%.txt
goto date
:Date
cls
echo Name -
type %story%.txt
Echo Type....
set/p "cho=>"
if %cho%==1 goto a
if %cho%==2 goto b
if %cho%==3 goto c
if %cho%==4 goto d
if %cho%==5 goto e
if %cho%==12 goto f
if %cho%==13 goto g
if %cho%==14 goto h
if %cho%==15 goto i
if NOT %cho%==1 goto type
if NOT %cho%==2 goto type
if NOT %cho%==3 goto type
if NOT %cho%==4 goto type
if NOT %cho%==5 goto type
if NOT %cho%==12 goto type
if NOT %cho%==13 goto type
if NOT %cho%==14 goto type
if NOT %cho%==15 goto type
if %cho%==help goto info
if %cho%==Help goto info
if %cho%==HELP goto info
pause
:A
echo echo ----
echo echo ---- >> %story%.txt
goto date
:B
echo echo %%name%%:
echo echo %%name%%: >> %story%.txt
goto date
:C
echo echo %%Girl%%:
echo echo %%Girl%%: >> %story%.txt
goto date
:D
echo echo %%Namefriend%%:
echo echo %%Namefriend%%: >> %story%.txt
goto date
:E
echo echo %%Nametown%%:
echo echo %%Nametown%%: >> %story%.txt
goto date
:F
echo echo ----
echo echo %%name%%
echo echo ---- >> %story%.txt
echo echo %%name%%: >> %story%.txt
goto date
:G
echo echo ----
echo echo %%Girl%%
echo echo ---- >> %story%.txt
echo echo %%Girl%%: >> %story%.txt
goto date
:H
echo echo ----
echo echo %%Namefriend%%
echo echo ---- >> %story%.txt
echo echo %%Namefriend%%: >> %story%.txt
goto date
:I
echo echo ----
echo echo %%Nametown%%
echo echo ---- >> %story%.txt
echo echo %%Nametown%%: >> %story%.txt
goto date


:Type
cls
set %cho%=type
echo echo %type% >> %story%.txt
goto date



Sponsored Link
Ads by Google

Response Number 1
Name: Holla
Date: March 24, 2009 at 02:14:31 Pacific
Reply:

Slight modification: you can probably start with this..... I also removed some cls for debugging.

@echo off
:Echo Name of Story?
set story=%~f1
if not exist %story%.txt set /p story=Name of story?
echo %story% >> %story%.txt
:Info
:cls
echo Info
echo Press a button and then press 
echo enter for the effect.
echo ---------------------------
echo echo ---- is 1
echo echo %%name%%: is 2
echo echo %%Girl%%: is 3
echo echo %%Namefriend%%: is 4
echo echo %%Nametown%%: is 5
echo ---------------------------
Echo Press 1 and 2 to get (12)
echo echo ----
echo echo %%name%%:
echo ______________________________
pause
:Type
:cls
set %cho%=type
echo echo %cho% >> %story%.txt
goto date
:Date
:cls
echo Name -
type %story%.txt
set /p cho=Type....
if "%cho%"=="1" goto a
if "%cho%"=="2" goto b
if "%cho%"=="3" goto c
if "%cho%"=="4" goto d
if "%cho%"=="5" goto e
if "%cho%"=="12" goto f
if "%cho%"=="13" goto g
if "%cho%"=="14" goto h
if "%cho%"=="15" goto i
if NOT "%cho%"=="1" goto type
if NOT "%cho%"=="2" goto type
if NOT "%cho%"=="3" goto type
if NOT "%cho%"=="4" goto type
if NOT "%cho%"=="5" goto type
if NOT "%cho%"=="12" goto type
if NOT "%cho%"=="13" goto type
if NOT "%cho%"=="14" goto type
if NOT "%cho%"=="15" goto type
if "%cho%"=="help" goto info
if "%cho%"=="Help" goto info
if "%cho%"=="HELP" goto info
pause 
:A               
echo echo ---- 
echo echo ---- >> %story%.txt
goto date
:B
echo echo %%name%%: 
echo echo %%name%%: >> %story%.txt
goto date
:C
echo echo %%Girl%%:
echo echo %%Girl%%: >> %story%.txt
goto date
:D
echo echo %%Namefriend%%: 
echo echo %%Namefriend%%: >> %story%.txt
goto date
:E
echo echo %%Nametown%%: 
echo echo %%Nametown%%: >> %story%.txt
goto date
:F
echo echo ---- 
echo echo %%name%%
echo echo ---- >> %story%.txt
echo echo %%name%%: >> %story%.txt
goto date
:G
echo echo ---- 
echo echo %%Girl%%
echo echo ---- >> %story%.txt
echo echo %%Girl%%: >> %story%.txt
goto date
:H
echo echo ---- 
echo echo %%Namefriend%%
echo echo ---- >> %story%.txt
echo echo %%Namefriend%%: >> %story%.txt
goto date
:I
echo echo ---- 
echo echo %%Nametown%%
echo echo ---- >> %story%.txt
echo echo %%Nametown%%: >> %story%.txt
goto date

:Type
cls
set %cho%=type
echo echo %type% >> %story%.txt
goto date

--
Holla.


0

Response Number 2
Name: rjone187
Date: March 24, 2009 at 16:28:19 Pacific
Reply:

So all you did was add "" ??
the most simple of things...

I did change one or two things to it.

But Thanks...
You ppl are great... :)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch - typing a story

batch transpose a matrix www.computing.net/answers/programming/batch-transpose-a-matrix/16191.html

Batch to edit Batch www.computing.net/answers/programming/batch-to-edit-batch/16925.html

Batch TYPE Command www.computing.net/answers/programming/batch-type-command/16952.html