Data Conversion with the PICSKIP Option

When data is displayed in a field, a conversion process takes place. The underlying data is converted to a string (an edit buffer) and displayed. The user edits this string representation of the data. The edit buffer is converted back to the underlying data type when the user exits the form. Using protected characters in a field affects the way this conversion is handled.

The system default is to include protected picture characters in the conversions. The field option that controls this behavior is PICSKIP. You can change this option.

Fields with the PICSKIP option turned OFF. If you want to include the protected characters in your data variable, you can turn the PICSKIP option OFF for the field. (Note: this is the default.) If PICSKIP is OFF, the form editor assumes that protected characters are present in the initial values when the form is displayed and should be stored in the data variable when the user exits the form. When the form is displayed, the form editor converts the data variable to the string representation, and then places the protected characters from the picture in the corresponding positions in the display string. The effect of this is that the protected characters block out whatever would ordinarily be displayed in the protected-character positions of the field.

When the user exits the form, the form editor includes the protected characters in the string that is converted and placed in the data variable. Therefore, the contents of a data variable can be changed by the protected characters, even if the user does not enter any data.

For example, if you created a field and initialized the data variable as follows:

Field type:
F_STRING
Field picture:
(UUU)UUU-UUUU
Data value:
8028487731

the data value would be converted and placed into the field before the protected characters were put into the field. After the form editor copied the protected characters into the field, the data displayed to the user would look like this:

Data displayed on form: (028)877-1

If the user did not enter anything in this field before exiting the form, the form editor would update the underlying data variable with the value displayed on the screen.

If the PICSKIP option is OFF, you need to include the protected characters when you are initializing the data variable. The correct way to initialize the data variable above is:

Data variable:
(802)848-7731
Data displayed on form:
(802)848-7731

Fields with the PICSKIP option turned ON. If you do not want to include the protected characters in your data variable, you can turn the PICSKIP option ON for the field. If PICSKIP is on, the form editor assumes that protected characters are not present in the initial data when the form is displayed; when the user exits the form, the form editor strips the protected characters out before putting the value into the data variable.

In the example above, if the PICSKIP option were turned on for the field, you would get the following results:

Field type:
F_STRING
Field picture:
(UUU)UUU-UUUU
Data value:
8028487731
Data displayed on form:
(802)848-7731

With the PICSKIP option ON, you must be careful not to include protected characters when initializing data. If you include the protected characters in the data, you get the following:

Data value:
(802)848-7731
Data displayed on form:
((80)2)8-48-7


Home Contents Previous Next