04-01-2023, 12:13 AM
(03-31-2023, 11:56 PM)PhilOfPerth Wrote: Is there an IsAlpha or IsNum (or equivalent) function in PE, to examine an input's type? If not, should there be?
I couldn't see one in Help or the Wiki.
I know we can use Select Case etc., but it would be much more convenient if these functions were available.
Functions like those are really handy (and necessary) for languages that don't rely on, or are very flexible with, variable types. Since QB64 requires a variable to have a type (integer, single, string, etc..) there would be no reason to have an IsAlpha or IsNum function. All variables created in QB64 without specifying a type default to SINGLE, therefore they are always "IsNum" so to speak.
If you want to test a string for a numeric value use VAL().