10-11-2015 01:29 PM
Hello All,
I am currently struggling to Error Trap an input to a Message Pop-Up to ensure it is only a numeric.
I am expecting a number to be entered, and then stored to a File.Globals as a Numeric (not a string). If the Operator was to enter nothing or a word, the routine does not work, and I am unsure how I would error trap an empty entry or characters that are not numbers (Numeric).
Could anyone be so kind to shed some light on this matter on how I would achieve this?
Many thanks in advance!
10-11-2015 11:41 PM
Did you think about using a loop ? Something like
Show messagePopup
Check input
Repeat this until input meets your conditions
10-12-2015 01:34 AM
HI,
You need to use the function VAL(arg a,arg b)
It converts string argument a to a number ( this is because message popup will only take string).
Argument b tells if the a is a valid number.
In a statement step :
Locals.numtemp=Val("q",Locals.isvalid) --- this will result in isvalid boolen as false and numtemp as 0
Locals.numtemp=Val("1",Locals.isvalid) -- numtemp will be 1 and isvalid will be true.
Hope this helps,
Ravi
10-12-2015 02:51 PM
Thanks Ravi,
It works a treat!
🙂