1.

Solve : Wildcards in a variable?

Answer»

Can I use wildcards when defining a variable name? Like this:

set num*=abc

If I have these variables: num1, NUM2, num3, etc.

Would be a pretty big timesaver if I could.you NEED a programming construct called an array. batch doesn't have that... (although in batch you could probably do a enable delayed expansion , use a for loop and set to CREATE each individual variables with those names)Quote from: gh0std0g74 on August 29, 2009, 06:18:30 PM

you need a programming construct called an array. batch doesn't have that... (although in batch you could probably do a enable delayed expansion , use a for loop and set to create each individual variables with those names)
So this should work?

For /L %%a in (1,1,10) do set num%%a=abc

Right?no it doesnt i just tried itQuote from: smeezekitty on August 29, 2009, 06:24:13 PM
no it doesnt i just tried it
Did you do that from the COMMAND prompt or a batch FILE? One % for command prompt, two % for batch file.oops i forgot that
yes it does work


Discussion

No Comment Found