I've not tested this, but it should give you the right idea. Tom's code tells you if something is numeric. It needs a little enhancing to tell you if it is integer, or decimal.
Code:
def var x as decimal no-undo.
x = decimal("111.33") no-error.
if error-status:num-messages gt 0 then
message "oops!".
else
do:
if truncate(x,0) ne x then
message "decimal".
else
message "integer".
end.
Thank you for the suggestions. I should be able to work with one of these.
Just to clarify the variable is a char type and is used to read input from a data file. That data can either be char or integer and I need to identify the integer values as they require some additional processing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.