Checking Integrity when Import Text Files

rrojo7229

Member
Hi,

Someone knows if it is possible colect the Error message code for the "assign, Int(), deci(), date()"?

I mean if I have a case where the data types does not matches those commands above will send a error message, but is it possible treat this? Instead send a error message to screen.

Assign i-number = INT(ENTRY(5,cLine))
d-dtsale =
IF INT(SUBSTRING(ENTRY(23,cLine),7,4)) <> 0
THEN DATE(ENTRY(23,cLine))
ELSE ?
de-csqty = DEC(ENTRY(9,cLine)) [NO-ERROR].


Progress 9.1C

Kind Regards,
Rrojo7229
 
If I read your question right, this may be what you are after:
Code:
def var i as int no-undo.
Assign i-number = INT(ENTRY(5,cLine))
d-dtsale = 
IF INT(SUBSTRING(ENTRY(23,cLine),7,4)) <> 0 
THEN DATE(ENTRY(23,cLine)) 
ELSE ?
de-csqty = DEC(ENTRY(9,cLine)) NO-ERROR.
 
IF ERROR-STATUS:ERROR THEN DO i = 1 to error-status:num-messages:
  message error-status:get-number(i) error-status:get-message(i) view-as alert-box.
END.

Paul
 
Back
Top