Midrange News for the IBM i Community

Posted by: neilrh
Jackson, MI
Multiformat - DSPATR(PC)
has no ratings.
Published: 26 Sep 2011
Revised: 23 Jan 2013 - 4101 days ago
Last viewed on: 12 Apr 2024 (6181 views) 

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.

Multiformat - DSPATR(PC) Published by: neilrh on 26 Sep 2011 view comments(3)

I have a screen built from multiple formats - say fmt1, fmt2, fmt3 & fmt4.


   write fmt1;
   write fmt2;
   write fmt3;
   exfmt fmt4;
   read fmt3;

 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)!!).


Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: Multiformat - DSPATR(PC)
Posted: 12 years 6 months 21 days 18 hours 56 minutes ago

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. Undecided

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Multiformat - DSPATR(PC)
Posted: 12 years 6 months 21 days 18 hours 53 minutes ago

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.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Multiformat - DSPATR(PC)
Posted: 12 years 6 months 21 days 17 hours 48 minutes ago

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.