On Sat, 22 Jan 2005 14:55:02 +0200, "BigMan" <(E-Mail Removed)> wrote:
>I would like the variable %I to iterate from 0 to %C-1 rather than from 1 to
>%C. Note that I cannot change the range of %C to0-9!
>
> for /L %%C in (1,1,10) do (
> for /L %%I in (1,1,%%C) do (
> echo %%C %%I
> )
> )
>
>What should I do?
>
@echo off
setlocal enabledelayedexpansion
for /L %%C in (1,1,10) do (
set /a cm1=%%C - 1
for /L %%I in (0,1,!cm1!) do (
echo %%C %%I
)
)
endlocal
Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com