Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
August 30, 2005
An integer is a whole number, like 0, or 9, or 1234.
The basic syntax used to determine if a variable or parameter is an integer is:
if VariableOrParameter EQU +VariableOrParameter CommandToExecuteIfInteger
if %1 EQU +%1 @echo %1 is an integer.if %1 NEQ +%1 goto errorif %var% EQU +%var% @echo Variable var contains an integer.For /f "Tokens=*" %%a in ('type %1') do ( if %%a NEQ +%%a @echo Line containing {%%a} in file %1 is NOT an integer.)
You May Also Like