Consultor Eletrônico



Kbase 21621: How To Empty a Field When Its Format Has Special Characters
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/04/2011
SUMMARY:

You might experience the following error messages if you attempt to assign a blank value to a character field which contains special characters in its display format:

** Character <char> at position <n> must be digit. (630)

- or -

** Character <char> at position <n> must be a letter. (631)

In a SmartObjects Application a second error message might also come up after either of those above:

** <program-name>: Unable to evaluate field for assignment. (143)

EXPLANATION:

Most likely, the error messages are expected because some of the special characters used in the display format of a character field do not allow for blank character as part of their representation.
Consider the character field display format, "!9!9", with an initial value of "A1B2". If you try to assign a blank value to that field, Progress displays the 631 error because the exclamation point (!) is a special character that represents a letter to be converted to uppercase during input, and does not allow for blank character as part of its representation.

SOLUTION:

In order to "empty" the contents of that character field and eventually eliminate those error messages, you should assign the Progress unknown value (?) to that field. If you are running Progress Version 9.X SmartObjects, then create an override version of the updateRecord ADM2 procedure and place the following statements into its code before standard behavior (RUN SUPER):

/* Code placed here will execute PRIOR to standard behavior. */
IF RowObject.<character-field-name>:SCREEN-VALUE
IN FRAME {&FRAME-NAME} = "":U THEN
ASSIGN RowObject.<character-field-name>:SCREEN-VALUE = "?":U.

NOTE that with Version 8.X SmartObjects, the procedure to solve this is the same except that you have to create a local copy of the update-record ADM1 procedure.


References to Written Documentation:

Progress Programming Handbook