PDA

View Full Version : how can I calicurate cursor positioin for x and y on the screen??



Guest.Visitor
01-01-1995, 02:00 AM
want to get cursor position of x and y... if anyone know, please show me a  example of display file and ile program..thanks..

B.Myrick
06-13-2000, 11:17 AM
Ken, You have to define the ROW and COLUMN in the DDS and then reference it in the RPG Program. I use this method: A CSRLOC(ROW COLUMN) A ROW 3S 0H A COLUMN 3S 0H Then in the RPG: fdspfil cf e workstn f infds(dspinfds) * Stand alone work fields * ----------------------- d put s 4s 0 * Cursor Location * --------------- d dspinfds ds d cursor_loc 370 371B 0 c cursor_loc div 256 row c mvr column c eval put=((row * 80)-1)-(80 - column) I have a 1839 byte field (the max field size I can get on a 24x80 screen) and when I use an F-Key the positition is returned to me. You can also place a value in ROW and COLUMN to position a data string. c eval %subst(vid24x80:put:column) = 'X' Hope this helps, Bret Myrick

David Abramowitz
06-13-2000, 11:19 AM
There are several ways of doing this, but none of them may be necessary depending on what you are trying to do. What are your goals and objectives? Dave

Guest.Visitor
06-13-2000, 02:19 PM
Put this in your DDS to rtv rec fmt and fld. A RTNCSRLOC(&CSRRCD &CSRFLD) A CSRRCD 10A H A CSRFLD 10A H ----------- Put this in your RPGIV to rtv the x & y coordinates (FINDS - File Info Data Structure) D DROW 370 370 D DCOL 371 371