![]() | ![]() | Programming Guide |
Forces validation for the specified object
int sm_validate(int obj_id);int sm_n_validate(char *widget_name);
obj_id- Object ID of the widget or screen to be validated, obtained from
sm_prop_idwidget_name- The name of the widget to validate. For fields, an occurrence number or element number can be included. For example,
sm_n_validate "field[[3]]")causes the third element of the named field to be validated.
sm_validatecauses the specified widget or screen to be validated. The specified widget must be on the current screen.The widget must be one of the following types:
- A field that is not a card. When
sm_n_validateis called,widget_namecan specify an occurrence or an element to validate. If not specified, the first element is validated.
- A tab card. Each field, grid and tab card in the card is validated.
#include <smdefs.h>
/* Call a grid validation function and return if it fails.
*/
int
validate (fieldnum, data, occurrence, bits)
int fieldnum, occurrence, bits;
char *data;
{
if (sm_n_validate ("grid1")
{
/* Stop processing if grid validation function fails */
return 1;
}
...
}