Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I have a screen built from multiple formats - say fmt1, fmt2, fmt3 & fmt4.
/free write fmt1; write fmt2; write fmt3; exfmt fmt4; read fmt3; /end-free
Fmt3 & Fmt4 have input capable fields, and I need to be able to indicate and error on these fields and force a position cursor. From my experimentation: setting the indicators for fields on Fmt4 will result in color(red) and dspatr(pc) working. But setting the indicatiors for fields on Fmt3 only results in color(red), the dspatr(pc) is ignored.
My assumption is that DSPATR(PC) only works on fields in the active record (in this case Fmt4). Does anyone know of a way to get cursor position on Fmt3 fields without resorting to manual cursor placement OR making Fmt3 my active (If I make Fmt3 active then fields on Fmt4 won't dspatr(pc)!!).
thanks
Right Neil, the last ouput/written format controls the position cursor.
You'd have to do a SetCursor position based on the field name or something like that. Maybe retrieve the field position using one of those APIs and then get its x,y coordinates and after EXFMT FMT4, set the position by row/column.
Yeah, that's what I figured. I hate having to retrofit this stuff into displays that are 18+ years old - it tends to break a bunch of other stuff.
You probably already know this, but seem to remember a thread on rpgiv.com forums about using QUSLFLD to get the row/column for positioning, so you don't have to hardcode.