String-to-Data Conversion

When the user exits from the form (as opposed to quits), the contents of the field are converted to a variable of the appropriate type. The variable is copied to the data variable associated with the field. The system calls the string-to-data conversion function that is appropriate for the defined field type. The system string-to-data conversion functions are all named with the prefix "dc_to" and are listed in Table 9.1. If you would like details on how the system is performing data conversion for a particular field type, see the description of the appropriate data conversion function in the Function Reference. Note that the conversion function expects the data variable pointed to for the field to be the proper type; if it is not, errors result.

For string variables (string, date, and time fields), the default is to copy the protected characters in the picture to the data variable (this is a field option that you can change).

You can control data conversion by setting a number of data field options.

Fields that have no underlying data variable are processed differently. See Chapter 7, "Standard Data Field Types."

Table 9.1: Data Field Processing Functions

Field Type Data-to-String Conversion Function Validation Function String-to Data Conversion Function
F_BOOL dc_frbool() vf_bool() dc_tobool()
F_CHAR dc_frch() vf_ch() dc_toch()
F_CHECK dc_frcheck() None dc_tocheck()
F_DATE dc_frdate() vf_date() dc_todate()
F_DECIMAL dc_frdec() vf_dec() dc_todec()
F_DOUBLE dc_frdouble() vf_double() dc_todouble()
F_F_INT dc_frint() vf_int() dc_toint()
F_LONG dc_frlong() vf_long() dc_tolong()
F_RADIO dc_frradio() None dc_toradio()
F_SHORT dc_frshort() vf_short() dc_toshort()
F_SINGLE dc_frsingle() vf_double() dc_frsingle()
F_STRING dc_frst() vf_st() dc_tost()
F_TIME dc_frtime() vf_time() dc_totime()


Home Contents Previous Next