I want to perform a check on the variable entered. The entered variable should be either a Numeric or Char or Varchar(0-9 or A-z)... No special chars allowed.
I used a function called DATATYPE('Var'), but that is giving a return code as CHAR when Special chars are entered.
Please let me know if there is some other built in function which can be helpful for me.
There is a function called COMAPRE(), but in which i should have the list of all the Special chars and if that is found in the string i can display a valid message.
I want to know if there is something else(easier) which can used for the above purpose.
Joined: 14 Mar 2007 Posts: 8593 Location: Back in jolly old England
I was going to say exactly the same as superk ........ until I tried a test.
If you specify type, returns 1 if string matches the type; otherwise returns 0. If string is null, the function returns 0 (except when type is X, which returns 1 for a null string). The following are valid types. (Only the capitalized and highlighted letter is needed; all characters following it are ignored. Note that for the hexadecimal option, you must start your string specifying the name of the option with x rather than h.)
000001 /* REXX **/
000003 ABC = "AB2"
000004 A = DATATYPE(ABC,A)
000005 SAY A
000006 ABC = "AB@"
000007 A = DATATYPE(ABC,A)
000008 SAY A
7 +++ A = DATATYPE(ABC,A)
Error running TESTPRO2, line 7: Incorrect call to routine
Is this just me, or is it a general problem / technical glitch ???