Midrange News for the IBM i Community


Posted by: neilrh
A/P
Jackson, MI
Multiformat - DSPATR(PC)
has no ratings.
Published: 26 Sep 2011
Revised: 23 Jan 2013 - 1729 days ago
Last viewed on: 17 Oct 2017 (4072 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.

 

/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

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

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Multiformat - DSPATR(PC)
Posted: 6 years 23 days 3 hours 8 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: 6 years 23 days 3 hours 5 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: 6 years 23 days 2 hours 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.