nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

Re: Custom variables in FOR loop - is this possible?

Von: Andreas Eibach (aeibach@mail.com) [Profil]
Datum: 04.10.2009 09:23
Message-ID: <7ir0sfF32a443U1@mid.uni-berlin.de>
Newsgroup: alt.msdos.batch.nt

"billious" <billious_1954@hotmail.com> wrote:

> To access the value of a variable, use %varname%, not %varname
>
> "%%d" means the value of the metasyntactic (loop-control) variable
"d"
> "%1" is the value of the first parameter to the batch file OR the first
> parameter to the INTERNAL subroutine (eg "extroutine")
>
> so your FOR line should read
>
> for /D %%d in (%d3% %d4%) do call :extroutine %%d %1

tadaa, now it works as expected!

thanks a ton!

and @foxidrive: nice effort, thanks too, but I prefer to not create any
error conditions (by non existing drives) which are just suppressed by
NUL-ing them, that seems a bit ugly to me! :)

-Andreas


[ Auf dieses Posting antworten ]