FOR %%VV IN (1 2 3) DO ECHO %%VV
why cant you have double V as a variable, why single always? what do call this kind of variable?
what if you run out of variables?
FOR %%VV IN (1 2 3) DO ECHO %%VV, why single V always?
Moderator: DosItHelp
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: FOR %%VV IN (1 2 3) DO ECHO %%VV, why single V always?
nnnmmm wrote:why cant you have double V as a variable, why single always?
Because that's how Microsoft decided to do it.
nnnmmm wrote:what do call this kind of variable?
A for loop variable. You may also see it called a for loop parameter or a token.
nnnmmm wrote:what if you run out of variables?
Then you seriously need to re-evaluate how you're parsing the data. Also, you aren't limited to letters; you can use almost any of the 128 basic ASCII characters.
Re: FOR %%VV IN (1 2 3) DO ECHO %%VV, why single V always?
You could use "enough" for-variables.
Key idea accessing huge amounts of for-variable names:
http://www.dostips.com/forum/viewtopic.php?p=51537#p51537.
List of characters that could be used as a for-variable name (in hexadecimal):
http://www.dostips.com/forum/viewtopic.php?p=51622#p51622.
(see Point 4)
You also could use many tokens simultaniously:
http://www.dostips.com/forum/viewtopic.php?p=51595#p51595.
penpen
Key idea accessing huge amounts of for-variable names:
http://www.dostips.com/forum/viewtopic.php?p=51537#p51537.
List of characters that could be used as a for-variable name (in hexadecimal):
http://www.dostips.com/forum/viewtopic.php?p=51622#p51622.
(see Point 4)
You also could use many tokens simultaniously:
http://www.dostips.com/forum/viewtopic.php?p=51595#p51595.
penpen
Re: FOR %%VV IN (1 2 3) DO ECHO %%VV, why single V always?
Please read the documentation for a command before you ask questions.
The help file for the FOR command is quite clear. All you had to do was read the first 3 lines of the help file for the FOR command.
Single does not equal double.
The help file for the FOR command is quite clear. All you had to do was read the first 3 lines of the help file for the FOR command.
Code: Select all
H:\>for /?
Runs a specified command for each file in a set of files.
FOR %variable IN (set) DO command [command-parameters]
%variable Specifies a single letter replaceable parameter.
Single does not equal double.
Re: FOR %%VV IN (1 2 3) DO ECHO %%VV, why single V always?
sorry about the question,
i just had to ask that once in my life as to what experts think about it.
i just had to ask that once in my life as to what experts think about it.