How to return the type of a variable ?

Discussions about CSEntry
Post Reply
thierryt
Posts: 47
Joined: April 26th, 2017, 12:17 pm

How to return the type of a variable ?

Post by thierryt »

Hi all,
please i need a function who return the type (numeric or alpha) of an item of dictionnary.
thanks !
Gregory Martin
Posts: 1792
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: How to return the type of a variable ?

Post by Gregory Martin »

There's no built-in function to do this, but you could do something like this:
function IsNumeric(string itemName)
    IsNumeric = ( getvalue(itemName) <> default );
end;
This would work in most cases, though if the item was numeric and value happened to be default, then it would falsely report as being alpha.
thierryt
Posts: 47
Joined: April 26th, 2017, 12:17 pm

Re: How to return the type of a variable ?

Post by thierryt »

OK Martin,
thank you !
Post Reply