VOGONS


First post, by dobiz

User metadata
Rank Newbie
Rank
Newbie

Hi,
The FOR command in batch files is missing.
The SHIFT command in batch file does not seem to work; instead of shifting the parameters it exits the batch.
Thanks for your help.

Reply 1 of 8, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

shift should work.
Got an example of what doesn't work ?
for isn't implemented

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 8, by dobiz

User metadata
Rank Newbie
Rank
Newbie

Example of a batch file with SHIFT:
--- begin cut here
@echo off
echo First parameter = %1
shift
echo Second parameter = %1
--- end cut here
Assume the file's name is trial.bat with the content above, running
"TRIAL 1 2 " should get this answer:
First parameter = 1
Second parameter = 2
But I only get:
First parameter = 1

Reply 3 of 8, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

right. It is broken because of the fact that batch files are now opened and closed on each line. (and the first argument is pushed into the filename.)
It works in 0.72

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 8, by dobiz

User metadata
Rank Newbie
Rank
Newbie

Ok, thanks for your answer.
Does it mean that I will not be able to use SHIFT and FOR, or will this be corrected in future versions?

Reply 5 of 8, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I have corrected "shift"

I haven't seen a game yet that needs "for". So maybe "for" will be supported in the future.

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 8, by dobiz

User metadata
Rank Newbie
Rank
Newbie

Ok, I will do without FORs.
Thanks, bye.

Reply 7 of 8, by robertmo

User metadata
Rank l33t++
Rank
l33t++

dobiz: have you found a game that uses "for" or you were just writing your own .bat file?

Reply 8 of 8, by dobiz

User metadata
Rank Newbie
Rank
Newbie

Not a game batch, only own written one.