While this code seems a little cumbersome, it is done for maximum flexibility. I assume you are using the OBJECT-MAINT-DIALOG model but I’m not sure since you didn’t say.
The reasons to generate this flexible code are:
• If the error field is on a different panel (screens that can scroll left and right - PF11 and PF12) then we want to navigate to the correct panel to mark the correct field. See the REINPUT-SCREEN subroutine that is generated. A good example to look at is NCOMENT in the NCSTDEMO library.
• If you have scrolling regions on your input then you may want to adjust the visible occurrences to point out the correct error field.
• There may be initializations in the NEW-SCREEN repeat that you may want to do again when re-displaying the screen. You may also have derived fields that you need to deal with as well.
One of the issues with using *FIELDNAME in the REINPUT statement is that it can’t be a variable. So Construct would have to generate REINPUT statements for every single field. Because of the scrolling issue, Construct generates the POS statements instead.
Also, in the code that you mentioned, there are some extra statements because you are using message numbers instead of message text. This would be needed anyway to lookup the error message.
Finally, regardless of all this, using a REINPUT statement with *FIELDNAME still doesn’t help with the positioning of scrolling panels if the field is not on the current input screen.
Hope this helps,