User Function Specifications

User Function Call and Description
Abort void abort_func (void)
  Passed no arguments. Terminate program cleanly. Return no value.
Begin- & End-Field, int function (DFORMPTR fmp)
Form, Scrollable Region,
Scrollable Region Row
Passed the pointer to the current form. Begin-field, begin-scrollable region, begin scrollable region row and begin-form should perform any desired processing prior to turning over control of the field, scrollable region, scrollable region row, or form to the user. End-field, end scrollable region, end scrollable region row, and end-form should specify actions taken after the user leaves the field, scrollable region, scrollable region row, or form. Return TRUE on success and FALSE on failure. A FALSE return will cause form processing to terminate.
Activate Window int act_func (WINDOWPTR wnp)
  Passed the pointer to the window being activated. Return TRUE if activation function succeeds, FALSE if it does not. A FALSE return will cause processing to stop.
Character Validation int vc_test (int * keyp)
  Passed the pointer to the keycode typed by the user. Should check validity of the character, given your definition of what characters are acceptable. The keycode pointed to by the argument can be modified. Return FALSE if keystroke is invalid, TRUE if keystroke is valid for the picture control character.
Data Conversion int dc_func (UCHAR *stp, PTR datap, DFIELDPTR dfldp, UCHAR *cvbufp)
  Passed pointers to a string, data variable, data field to be converted, and conversion buffer. The variable-to-string conversion function must convert the variable from its base type to its string representation and place this string in the string buffer. It must handle protected picture characters according to the setting of the PICSKIP field option. The string-to-variable conversion function must convert the string representation of the variable to its correct type and place the result in the assigned variable. It must recognize and handle the PICSKIP and TRAILBLANKS field options. Return TRUE for success, FALSE if error occurred.
Error Reporting void err_report (UCHAR func_name)
  Passed the pointer to a function name string. Should act on errors that occur during the running of a program. Return no value
Data Field Validation int vf_user (UCHAR *editbufp, UCHAR *picp, DFORMPTR fmp)
  Passed pointers to the edit buffer, picture for the field, and form being processed. Should validate field entry. Return FALSE if invalid, TRUE if valid.

Form Validation int vfm_user (DFORMPTR fmp)
  Passed the pointer to the current form. Should validate form entries. Return FALSE if invalid, TRUE if valid.
Initialization void init_func (void);
  Passed nothing. Perform additional initialization tasks. Return nothing.
Event int evnt_func (PTR structurep, EVENTPTR evntp);
  Passed a pointer to a structure appropriate for the current process. For data-entry, scrollable region, memo, and menu keytables, this is the pointer to the current form. For choice lists, help, and viewing, this is a pointer to a view structure. Perform tasks depending on current system. Return TRUE if success. A FALSE return is a fatal error, and will cause processing to terminate.
Keyboard Filter int keyfilter_func (keycode)
  Passed the keycode value by ki(). Should perform the required actions based on the keycode value passed. If 0 returned, ki() discards the current keycode and begins the read sequence again. If non-zero returned, ki() returns this value.
Keyloop int keyloop (int counter)
  Passed a counter value by ki() that indicates how many times the keyloop function has been called (KL_INIT, KL_WAIT, KL_DONE). Do processing while waiting for keystroke. Return 0 to continue waiting for keystroke, non-zero value to use as keycode.
Menu Action int mn_action (MFORMPTR mfmp)
  Passed pointer to the menu form that the action function is called from. Perform action. Return FUNCERROR to make an error return; EXITMENU to exit menu system; TOPLEVEL to return to the top-level menu; SAMELEVEL to return to the same menu; or positive integer to move up x number of menu levels. FUNCERROR return will cause menu processing to terminate.
Memo Validation int vm_user (MFILEPTR mfp, PTR ptr, DFORMPTR dfmp)
  Passed pointer to the memory file structure and form being processed. The second argument does not point to any valid data and should not be referenced in your function. The memory file pointer should also not be referenced. This function should validate field entry. Return FALSE if invalid, TRUE if valid. (If you want to get the string that was entered, call fld_get().)
Picture Validation int picval_func (UCHAR *picp, UCHAR *allowed_picch, int flags)
  Passed pointers to a picture string, a string containing the allowed picture characters for the field type, and an integer containing the picture flags for the field type. Should test if the picture string is valid for the field. Return TRUE if the picture is valid, FALSE if the picture is invalid.
Pushbutton Action int pb_action(FORMPTR fmp)
  Passed a pointer to a data form that the action function is called from. Perform action. Return TRUE on success and FALSE on failure. A FALSE return will cause form processing to terminate.
Range Setting int rgset_func (PTR minp, PTR maxp, DFIELDPTR dfldp)
  Passed pointers to the minimum value, maximum value, and field structure. Should set the range of allowed values for the field. Return TRUE if the range structure was successfully initialized and FALSE if an error occurred.
Scrollable Region,

Begin-row, End-row

int srrow_func (DFORMPTR fmp)
  Passed the pointer to the current form. The begin-row function should perfom any desired processing before starting to process the first field on the row. The end-row function should perform actions taken after the last field in the row is processed. Return TRUE on success, FALSE on error. A FALSE return will cause form processing to terminate.
Scrollable Region int srscrl_fp (int delta_rowq, DFORMPTR dfmp)
Scroll Passed the change in user's row position and the current form pointer. Should scroll another object along with the scrollable region or perform other processing necessary. Return TRUE for success, FALSE for failure. A FALSE return will cause form processing to terminate.
Suspend Window int susp_func (WINDOWPTR wnp)
  Passed the pointer to the window being suspended. Return TRUE if suspend function succeeds, FALSE if it does not. A FALSE return will cause processing to stop.
System Field int vf_func (UCHAR *stp, UCHAR *picp, DFIELDPTR dfldp, UCHAR *cvbufp)
Validation Passed pointers to a string, picture, data field, and conversion buffer. Should check that the value is within the specified range for the field and perform other checks as necessary. Return TRUE if the string in the field is valid and FALSE if it is not valid.
Virtual Form Scroll int vscrl_fp (init delta_rowq, int delta_colq, FORMPTR fmp)
  Passed the change in the user's row and column positions within the virtual form, and the current form pointer. Should scroll another object along with virtual form or do other necessary processing. Return TRUE on success, FALSE on error. A FALSE return will cause form processing to terminate.


Home Contents Previous Next