I used SDA to create the above - put an 8 next to the SFLCTL, a Y for Select record keywords. Y for General keywords, Y for RTNCSRLOC and Y for Select paramaters (there may not be an option to put a Y next to RTNCSRLOC - that's ok, put it for Select paramaters) - put a Y for RTNCSRLOC and *RECNAME, put the fields names (CSRRCD, CSRFLD, CSRPOS in my example).
Enter all the way back out - and add those fields as hidden fields in the record.
Announcement
Collapse
No announcement yet.
Determining which column
Collapse
X
-
Ok - I've been learning, always a good thing.
In your DDS - after the SSFLCTL statement:
Code:A RTNCSRLOC(*RECNAME &CSRRCD &CSRFLD - A &CSRPOS) ... A CSRRCD 10 H A CSRFLD 10 H A CSRPOS 4 0H
Leave a comment:
-
Birgitta,
Thank you! Comes from seeing way too much RPG/400 code...
Rocky
Leave a comment:
-
Can be done even easier and without any calculation:
Code:Dcl-Ds Wsds; Row Int(3) Pos(370); Col Int(3) Pos(371); End-Ds;
Leave a comment:
-
Another alternative would be to make the column headings be variables instead of constants, so you could determine which column heading the cursor was on by which column heading field name was returned to your program.
Leave a comment:
-
On your workstation file add an INFDS to the keywords if it's not already there. In the Data structure specified by the INFDS
Code:Dcl-Ds Wsds; Row Int(5) Pos(370); End-Ds; Dcl-S Row# Int(3); Dcl-S Col# Int(3);
Code:Row# = Row / 256; Col# = %Rem(Row : 256);
Leave a comment:
-
Couldn't you use the Row and Column numbers to determine which heading the cursor is sitting on? Of course, this implies that if you alter the position of the column headings in the DDS then your code would also have to be changed to accomodate the Row/Col change.
Another idea: If you have extra function keys available - you could set them up to perform column sorting based on keypress.
Leave a comment:
-
In other words, if the cursor is on the CUSTOMER# heading, then sort the file that is written to the subfile in customer# order. If the cursor is on the ORDER# heading, sort the file by order# before writing it to the subfile
Leave a comment:
-
Originally posted by Terry Wincheste View PostNot sure I understand exactly what your trying to retrieve, bu these are the DDS values I usually use to retrieve screen/subfile positioning information:
Leave a comment:
-
Not sure I understand exactly what your trying to retrieve, bu these are the DDS values I usually use to retrieve screen/subfile positioning information:
Code:CSRLOC(M3LINNBR M3COLNBR) RTNCSRLOC(&M3SUBRCD &M3SUBFLD) RTNCSRLOC(*WINDOW &M3ROW &M3COL) SFLCSRRRN(&M3SUBRRN) M3RRN 4 0H SFLRCDNBR(CURSOR) M3MODE 1 H M3ROW 3 0H TEXT('Current Row') M3COL 3 0H TEXT('Current Column') M3LINNBR 3S 0H TEXT('Line Number') M3COLNBR 3S 0H TEXT('Column Number') M3SUBRRN 5S 0H TEXT('Subfile Cursor RRN') M3SUBRCD 10 H TEXT('Cursor Loc Record') M3SUBFLD 10 H TEXT('Cursor Loc Field')
Leave a comment:
-
Determining which column
I need to display records in a subfile sorted in an order determined by which column heading the cursor resides on. I know there is a way to determine which field the cursor is place on, but this is based on column heading. I assume you would have to determine what the row# range and column# range is. Anyone know another way?Tags: None
Leave a comment: