Validate format on dynamic widget

Status
Not open for further replies.

Sven Persijn

New Member
I'm trying to validate the format of a dynamic widget. However, this is not possible with the no-error statement.
I've tried the following:

DEFINE VARIABLE hField AS HANDLE NO-UNDO.
CREATE <WIDGET> hField NO-ERROR
ASSIGN
DATA-TYPE = "INTEGER"
FORMAT = "FDDGH".
IF ERROR-STATUS:ERROR THEN MESSAGE <MESSAGE>.

Strange enough, this gives no error-message.

Even an assign of the screen-value doesn't give an error-message... Thus:
...
hField:SCREEN-VALUE = "301894dfasd" NO-ERROR.
IF ERROR-STATUS:ERROR THEN MESSAGE <MESSAGE>.
 

RKR

Member
Sven,

You might try the following. Extra lines are in lower case.

DEFINE VARIABLE hField AS HANDLE NO-UNDO.
define variable iNum as integer no-undo.

CREATE fill-in hField no-error
ASSIGN
DATA-TYPE = "INTEGER"
FORMAT = "FDDGH".

do iNum = 1 to error-status:num-messages:
message error-status:get-message(iNum).
end.


I always check on the NUM-MESSAGES attributes of the ERROR-STATUS system handle since ERROR-STATUS:ERROR does not always fire.

Hope this helps.

Ruud
 
Status
Not open for further replies.
Top