Changing the System Picture Control Characters

Each picture control character used by the system is associated with a character validation function. The picture control characters and their associated character validation functions are set in the _dpictbl[ ] table in vv_main.h. A sample entry from that table is listed below:

{'9', vc_digit},
 

This entry in the table means that when the character '9' appears in a picture, the function vc_digit() is called as the character validation function during field editing. Function vc_digit() ensures that the character entered in the field is any digit from 0 to 9, a plus sign, or a minus sign. If the character typed in the field is not valid, the system does not print the character in the field, and the system beeps (if beeping on no action is enabled).

To change the character used as a picture control character, replace the character in the picture table with one of your choosing. For example, if you want to use an ampersand as the picture control character for digits, change the above entry in the table to the following:

{'&', vc_digit},
 

Picture control characters also appear in the field type information table _fldinfo[ ] in vv_main.h. The field type information table contains information specific to each field type in the system. The allowed picture characters for each field type are included in this table. For example, the entry for a date field is as follows:

{FIELDTAG, dc_todate, dc_frdate, vf_date, PICVALFP, OFF_STRING, 0, 0,

sizeof(RGLONG), TRAILBLANKS, (UCHAR *) "9UA*!X", rgset_date, ALLOW_PROT_CH | ALLOW_MULT_PICSYM },


This entry is a structure of type FLDTYPE. The eleventh member of the structure, in this case "9UA*!X", is a list of the allowed picture characters for the field type.

If you change a picture control character, you must look at each entry in the field type information table and change the allowed picture characters appropriately. If you change the picture control character '9' to '&', you would change the allowed picture characters in the above entry to "&UA*!X".


Home Contents Previous Next