Permalink
Browse files

Update isInteger.bat

  • Loading branch information...
npocmaka committed Oct 25, 2017
1 parent ec4fa08 commit 533b9caa041247ec6b4544278cc9bcb96aaeac59
Showing with 20 additions and 13 deletions.
  1. +20 −13 math/isInteger.bat
View
@@ -1,18 +1,25 @@
@echo off
@echo off
:isInterer input [returnVar]
setlocal enableDelayedexpansion
set "input=%~1"
:isInterer input [returnVar]
setlocal enableDelayedexpansion
set "input=%~1"
if "!input:~0,1!" equ "-" set "input=!input:~1!"
for %%# in (1 2 3 4 5 6 7 8 9 0) do (
set "input=!input:%%#=!"
)
if "!input!" equ "" (set result=true
if "!input:~0,1!" equ "-" (
set "input=!input:~1!"
) else (
set result=false
if "!input:~0,1!" equ "+" set "input=!input:~1!"
)
endlocal & if "%~2" neq "" (set %~2=%result%) else echo %result%
for %%# in (1 2 3 4 5 6 7 8 9 0) do (
if not "!input!" == "" (
set "input=!input:%%#=!"
)
)
if "!input!" equ "" (
set result=true
) else (
set result=false
)
endlocal & if "%~2" neq "" (set %~2=%result%) else echo %result%

0 comments on commit 533b9ca

Please sign in to comment.