On Tuesday, March 23, 1999, 02:10 PM, Jim Hicks wrote: How do you handle errors? This is a major design issue for modular code. If a error occurs, we want the presentation program to display a message and highlight the field that has an error. A message like, invalid part number on a 100 line order is unacceptable. There must be a way for the presentation program to tie the errors returned from the business rules program to particular line item and field. To do this you need some table of return codes that are identified by the line and field that the code belongs to.
We've spent quite a bit of time on this one, and haven't yet come up with the ideal solution. For the moment, the post-enter logic in the presentation program looks like this (read X_ fields to be the actual display fields, and the set/get/edt procs reside in the 'object' service program):
callp setField1(X_FLD1) callp setField2(X_FLD2) eval MsgID=edtField1(Parms) if MsgID<>*BLANKS callp dspError('X_FLD1':MsgID:Parms) endif eval MsgID=edtField2(Parms) if MsgID<>*BLANKS callp dspError('X_FLD2':MsgID:Parms) endif eval X_FLD1_D=getField1Desc eval X_FLD2_D=getField2Desc