Setting Multiple Variables

Gigabyte / Nvdaacpi
May 8, 2009 at 20:25:45
Specs: OS 9.1, 333 GHz / 128 MB
I am writing a Chess game in batch and i
was wondering how i could set multiple
variables as the same thing. I tried
something like:

FOR %%a IN ("A1" "A3" "A5") DO SET %%a=XX

But this does not seem to work.
I am using my mac to post this question
as my XP computer doesn't want to
connect to the internet, it seems to have
self-deleted my ethernet driver and i dont
know which to download :P

Thanks ahead,

See More: Setting Multiple Variables

Report •

May 9, 2009 at 03:24:09
In Windows XP you can set multiple variables at one time by coding

  FOR %%a IN (A1 A3 A5) DO SET %%a=XX

Enclose the items inside the clause by double quotes if they are strings as

  for %%j in ("My Dog" "My Love" "My Car") do echo. %%j

Another way is to type Quotes using the variable modifier ~

  FOR %%a IN ("A1" "A3" "A5") DO SET %%~a=XX

Tip: Post the OS you want the answer applies to, not that you are occasionally running.

Report •

May 9, 2009 at 03:33:20
Thanks alot, my "'s were clearly pointless as i wasn't using

Yes, i am using winXP, i just didn't change it from mac on my first
post so i added the end bit in an edit.

The code doesn't work on my computer, i think i have screwed it
once again! anyways, thanks for replying

Report •

Related Solutions

Ask Question