I need to check if a variable is entirely made of digits, i.e. if it is a number. After that, I want to know if it is positive. Basically, I want it to be a positive number.
The last part is easy, since
Code: Select all
"$foo" > "0"But what about the first part? According to Help
Code: Select all
If you compare two numerical strings, they are compared as integers:
msg ("2" < "10"); // -> true! (both parts are numeric)
msg ("2" < "10a"); // -> false! (only one parts numeric)
msg ("2a" < "10a"); // -> false! (both parts are non-numeric)Code: Select all
"$foo" > "0"Code: Select all
$delay = "bar";
msg ("$delay" > "0");
XYplorer Beta Club