PIC_ApplyPictureString
Validates the current field by using the specified picture string.
Syntax
bool PIC_ApplyPictureString (StrParam)
Parameters
The picture string to validate the field. Smart parameters are supported.Returns
False, if called at the wrong level, if the picture string is longer than the field value or if the field fails the picture string validation. Otherwise, True.Level
Field level.Details
Validates the current field using a runtime PictureString as an argument. See the PIC_FormatFields action for picture string details.Using the provided picture string, this action will test that each of the characters in the current field are allowed. The provided picture string must be the same length or shorter than the data on the field. If the picture string is shorter, then the last character of the picture string will be used to validate all remaining characters in the field.
See the help for action PIC_FormatFields for an overview of picture strings. Unlike PIC_FormatFields which uses the PictureString variable, PIC_ApplyPictureString accepts the picture string as a variable only.
- Example
PIC_SetPictureCharacter("0,01") PIC_SetPictureCharacter("1,0123") PIC_SetPictureCharacter("2,-./") PIC_ApplyPictureString("0N21N2NN")This example creates custom picture strings for 0, 1 and 2. They are then used here to provide tighter control on the allowed input. "0N21N2NN" format matches a typical 6 digit date specification like "01/07/67".