Re: 'IsNumber' and 'IsAlpha' functions syntax


Hello James,

James McBride wrote:
I cannot seem to use these functions properly. I have the following simple
loop to get some input and say 'Is It alpha' (or is it numeric, when I
change it.


^!Set %InVal%=^?{(S=10)}

^!Prompt Value Entered is ^%InVal%

^!If ^$IsAlpha(^%InVal%)$=1 ^!Prompt "Is Alpha" else ^!Prompt "Is Not

^!GoTo GetInput
It seems you can't have the prompt code on the same line as the If statement. If you split it up it works.

^!Set %InVal%=^?{}
^!Prompt Value Entered is ^%InVal%
^!If ^$IsAlpha(^%InVal%)$=1 next else notalpha
^!Prompt Is Alpha
^!Goto end
^!Prompt Is Not Alpha
^!GoTo GetInput


Join to automatically receive all group messages.