Originally Posted by
wantonman
thanks theres no definate answere i switches %%A to %%z i still get same results and to as my unknowingness this is something tricky...
i read that you can use ascii A-Z and a-z and 0-9 for variables in for loops
http://judago.webs.com/variablecatches.htm
this is the best but it still doest say anything about a for variable used with another for variable...
It's confusing exactly what you want to do..
Try this (which is now syntactically correct due to the extra quotes).. Without them, it looks for a file called "mdeeekkkke54m45y54ym54y"..
Batch Code:
@echo off
setlocal enabledelayedexpansion
for /f "tokens=1-20 delims=m" %%a in ("mdeeekkkke54m45y54ym54y") do (
echo %%a
echo %%b
echo %%c
for %%d in (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) do (
echo %%%%%%d
)
)
I ran it using:
cmd.exe /c foo.bat
and the results are:
Code:
deeekkkke54
45y54y
54y
%%a
%%b
%%c
%%d
%%e
%%f
%%g
%%h
%%i
%%j
%%k
%%l
%%m
%%n
%%o
%%p
%%q
%%r
%%s
%%t
If that's not what you want, I'm lost..
Do you want the equivalent of the following? Or is the above correct already?
Java Code:
for (char c
: "mdeeekkkke54m45y54ym54y".
split("m")) { //might not be syntactically correct but meh.. for (char d
: new char['a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i', ....
]) { if (d
== c
) System.
out.
println(c
); } }// OR??.. which makes not very much sense but sure..??for (char c
: "mdeeekkkke54m45y54ym54y".
split("m")) { //might not be syntactically correct but meh.. //C will get re-assigned to whatever value is in the array.. for (c
: new char['a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i', ....
]) { System.
out.
println(c
); } }
Describe what you need or even write it in any other language and we can probably help/translate or figure it out.