PDA

View Full Version : Variable Naming Parsing Too Agressive?



NewsArchive
09-25-2007, 01:35 AM
FYI:

I was adding a "Run Program" line. The program was "cmd.exe", and the
command line was:

/c for %1 in (st_*.gid) do if exist "%DIRBIN0%\%1" del "%DIRBIN0%\%1"

I got a compiler error regarding this *variable* not being previously
assigned:

%1 in (st_*.gid) do if exist "%

I would have expected that the inclusion of so many
non-variable-name-characters between the two parentheses would cause
SB to recognize that it wasn't really a variable name. <g>

Anyway, I worked around it by creating another variable called
%DELPARM%, and then I replaced the three occurrances of %1 with that.

Mike Hanson
www.boxsoft.net

NewsArchive
09-25-2007, 01:36 AM
And when I work-around didn't work, I woke up and realized that I
should have used %%1. Duh!

Mike Hanson
www.boxsoft.net