Search found 2 matches

by dthvw
06 Oct 2014 11:00
Forum: DOS Batch Forum
Topic: Return value by reference from within a for loop
Replies: 5
Views: 3218

Re: Return value by reference from within a for loop

Hi, file a.bat: rem # don't show console output @echo off rem # call some batch file with argument c call b c rem # show contents of c echo %c% rem # wait for user input pause file b.bat: rem # enable evaluating loop variables at runtime SetLocal EnableDelayedExpansion rem # handle all individual li...
by dthvw
05 Oct 2014 02:21
Forum: DOS Batch Forum
Topic: Return value by reference from within a for loop
Replies: 5
Views: 3218

Return value by reference from within a for loop

Hi, I would like to use call by reference. This works fine: a.bat call b.bat c echo %c% b.bat set %1=555 However inside a FOR loop: %1=%aa <--- this works fine %1='d' <--- this does not work, although d contains some valid value if using some call (from inside the loop) the original %1 value is dest...