Tom Del Rosso
2024-03-13 03:52:24 UTC
I want to know if a variable equals a number, with no letters in it.
I know you can check with FOR /F "DELIMS=0123456789" but it looks like a
simpler way is just to test like so:
if A gtr 1000 echo That's a letter
or
if 4A gtr 1000 echo That contains a letter
This assumes that I know what the highest possible number will be, so if
the first value is a number it will always be less.
Is there a problem in doing this?
I know you can check with FOR /F "DELIMS=0123456789" but it looks like a
simpler way is just to test like so:
if A gtr 1000 echo That's a letter
or
if 4A gtr 1000 echo That contains a letter
This assumes that I know what the highest possible number will be, so if
the first value is a number it will always be less.
Is there a problem in doing this?
--
Defund the Thought Police
Defund the Thought Police