Page 1 of 1
Error mesage
Posted: April 1st, 2016, 9:39 am
by Mr.sharipov
how to display a message when the field is a numeric type blank? not a system error "out of range"
Re: Error mesage
Posted: April 1st, 2016, 9:59 am
by Saint
Can use this code:
Code: Select all
if var = notappl or missing then "type error message to display here"; endif;
Re: Error mesage
Posted: April 1st, 2016, 10:37 am
by josh
You don't want "missing" in the check. If a numeric field is blank the value in logic will be "notappl". Missing is used when you have a special code designed in the value set for missing, not for blank fields. Also you need to use errmsg() to show the message.
if var = notappl then
errmsg("type error message to display here");
endif;
Re: Error mesage
Posted: April 4th, 2016, 3:40 am
by Mr.sharipov
Thank you, but this code does not work. When you leave the type of numerical empty leaving a message "ot of-range"
Re: Error mesage
Posted: April 4th, 2016, 6:04 am
by josh
The out of range if from the system built in range check which does not allow blank (notappl) if you are in system controlled mode. You can turn this off using the set behavior statement:
set behavior(MYVAR) canenter(notappl) on (noconfirm); // turn of blank check for field MYVAR
or
set behavior() canenter(notappl) on (noconfirm); // turn of blank check for all fields
Note that some people using system control mode prefer to use a missing value instead of blank to make is easier to distinguish between fields that the user left blank and fields that were skipped using the skip statement which are also set to notappl.