How to know the Datatype of a Value?

Pranoy

Active Member
Hi,

I have a Form Control in which I'm entering some value, based on my value entered in Form Control I want to know what is the Datatype of that value entered. Can anyone help me in this....

Thanks in Advance.
 
Well, strictly speaking it is the data type of the control (MATH_NUMERIC, JDEDATE, CHAR, STRING, etc.). If it is invalid for that control data type, the default APPL behavior will throw an error on the control. So if a user enters "ABC" in a number or date field an error will be thrown.

Now what I suspect you are asking is:

"I have a control that is a STRING data type, I want to know if the user enters a string that could be converted to a number, a date, etc.?"

For that you will simply need to parse the string and determine. There may be some ER code system functions that are "Is a number" type functions????? I would probably do it in C and then depending on what you are testing for there are probably a multitude of ways to go about it using either jde api calls, standard ANSI C calls, roll your own logic, etc.
 
Back
Top