Answer the question
In order to leave comments, you need to log in
How to merge functions correctly in cmd GTR LSS?
set cntStart=1
set cntEnd=200
set number=
set addZero=2
setlocal enabledelayedexpansion
for /l %%i in (%cntStart%,1,=%cntEnd%) do (
if %%i LSS 10 (
if %addZero% EQU 1 (
set number=0%%i
) else if %addZero% EQU 2 (
set number=00%%i
) else (
set number=%%i
)
) else if (%%i GTR 10 & %%i LSS 100 (
if %addZero% EQU 1 (
set number=%%i
) else if %addZero% EQU 2 (
set number=0%%i
) else (
set number=%%i
)
) else (
set number=%%i
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question