d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Looping For Help With A Quick Question.
Prev12
Add Reply New Topic New Poll
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Oct 13 2012 03:42pm
Ah, yes.

Code
echo %a% > %HOMEPATH%\math.txt

overwrites the file

Code
echo %a% >> %HOMEPATH%\math.txt

appends to the file

so just make sure the first time you access the file, you overwrite the old one, then just append to it after that

This post was edited by Azrad on Oct 13 2012 03:44pm
Member
Posts: 31,187
Joined: Aug 31 2008
Gold: 28,306.50
Trader: Trusted
Oct 13 2012 05:36pm
Quote (Azrad @ Oct 13 2012 04:42pm)
Ah, yes.

Code
echo %a% > %HOMEPATH%\math.txt

overwrites the file

Code
echo %a% >> %HOMEPATH%\math.txt

appends to the file

so just make sure the first time you access the file, you overwrite the old one, then just append to it after that


fixed it :)
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Oct 13 2012 06:03pm
is this a specific language or something, looks neat
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Oct 13 2012 06:42pm
Quote (Eep @ Oct 13 2012 05:03pm)
is this a specific language or something, looks neat


It's windows batch, or ms-dos I guess. Not really sure what the official name is. Basically you save a text file as something.bat then you just type the name of the file from the command prompt to execute it. Typically its used for quick down and dirty stuff (and the code you see above is very down and dirty).

http://www.infionline.net/~wtnewton/batch/batguide.html
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll