× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: Cursor positioning
  • From: "Martin, Booth" <BoothM@xxxxxxxxxxx>
  • Date: Fri, 5 Nov 1999 14:39:03 -0500

returning the cursor location row and column is available with DDS as
follows (from Code/400 's on-line Help):

"Use this record-level keyword to return the location of the cursor to an
application program. 

This keyword may be specified in two formats. These formats are: 

 o Return the name of the record and field in which the cursor is currently
positioned.  Optionally, a third parameter may be specified that will
contain the relative cursor position within the field. 

 o Return the row and column position of the cursor relative to the display.
Optionally, two additional parameters may be provided that will return
either the row and column position of the cursor relative to the active
window (if one exists) or the location of the cursor at the beginning of the
two event mouse button definition. 
 
 The formats of the keyword is: 

 RTNCSRLOC([*RECNAME]
 &cursor-record &cursor-field
 [&cursor-position])
 or
 RTNCSRLOC({*WINDOW | *MOUSE}
 &cursor-row &cursor-column
 [&cursor-row2
 [&cursor-column2]])
 
 The parameter for the first format are: 

 o The *RECNAME parameter indicates that RTNCSTLOC should return the name of
the record and field on which the cursor is positioned.  Optionally, it will
also return the relative position of the cursor with the field. This
parameter is optional. 

 o The cursor-record parameter specifies the name of a hidden field that, on
input, will contain the name of the record on which the cursor is located.
The field must be defined in the record format as a character (A in position
35) field of length 10, with usage H (hidden). If the cursor is not in a
record area on input, the cursor-record field will contain blanks. 

 o The cursor-field parameter specifies the name of a hidden field that, on
input, will contain the name of the field on which the cursor is located.
The field must be defined in the record format as a character (A in position
35) field of length 10, with usage H (hidden).  If the cursor is not located
on a field on input, the cursor-field field will contain blanks. 

 o The optional cursor-position parameter specifies the name of a hidden
field that, on input, will contain the relative position of the cursor
within the field on which it is located.  The field must be defined in the
record format as a signed numeric (S in position 35) field of length 4, with
0 decimal positions and usage H (hidden).  If the cursor is in the first
position of the field, the cursor-position field will contain the value 1.
If the cursor is in the ith position, the cursor-position field will contain
the value i.  If the cursor is not located on a field, the cursor-position
field will contain the value 0. If the cursor is located in a menu-bar or
selection-field list, then the cursor position parameter returns to the
choice number on which the cursor is located. 
 
 All three fields specified on the RTNCSRLOC keyword will contain values on
input if the cursor is outside the  area of the record that contains the
RTNCSRLOC keyword.  The fields also contain values on input if the  cursor
is located in a subfile.  The cursor-record field will contain a value if
the cursor is located anywhere  inside the subfile.  The cursor-field and
cursor-position fields will contain values if the cursor is located on a
field within the subfile. 

 The parameters for the second format are: 

 o The *WINDOW or *MOUSE parameter is used to qualify the cursor-row2 and
cursor-column-2 
   parameters.  *WINDOW causes these parameters to return the cursor
location relative to the first useable location in the active window. *MOUSE
causes these parameters to return the location of the cursor just before a
two event mouse definition is processed. 

 o The cursor-row parameter specifies the name of a hidden field that, on
input, contains the number of row on which the cursor is located.  The field
must be defined in the record format as a data type S, field length of 3,
usage of H, and zero decimal positions.  The value returned in this hidden
field will be relative to the entire display where the first row of the
display is row 1. 

 o The cursor-column parameter specifies the name of a hidden field that, on
input, contains the number of the column on which the cursor is located.
The field must be defined in the record format as a data type S, field
length of 3, usage of H, and zero decimal positions.  The value returned in
this hidden field will be relative to the entire display where the first
column of the display is column 1. 

 o The optional cursor-row2 parameter specifies the name of a hidden field.
If *WINDOW was specified as the first parameter, the hidden field will
contain the relative row position of the cursor to the first useable
location of the active window.  If there is no active window, this value
will be the same as &cursor-row.  If the cursor is in the first useable
position of the window, the cursor-row2 field will contain the value 1.  If
the cursor is outside of the active window, it is possible for this value to
be a negative number. If *MOUSE was specified as the first parameter, the
hidden field contains the row number of the cursor at the instant just
before a two event mouse definition was called.  If a two event mouse
definition has not been processed, this field will be set to zero.  The
field must be defined in the record format as data type S, field length of
3, usage H, and zero decimal positions. 

 o The optional cursor-column2 parameter specifies the name of a hidden
field.  If *WINDOW was specified as the first parameter, the hidden field
will contain the relative column position of the cursor to the first useable
location in the active window. If there is no active window, this value will
be the same as &cursor-column.  If the cursor is in the first useable
position of the window, the cursor-column2 field will contain the value 1.
If the cursor is outside of the active window, it is possible for this value
to be a negative number. If *MOUSE was specified as the first parameter, the
hidden field will contain the column number of the cursor when the first
event of a two event mouse definition has occurred. If a two event mouse
definition has not been processed, this field will be set to zero. The field
just be defined in the record format as data type S, field length of 3,
usage of H, and zero decimal positions. 
 
 Both formats of this keyword may be specified with the same record.  If the
same hidden field is used multiple times for any of the parameters,
unpredictable results will occur.  Option indicators are not valid for this
keyword. 

-----Original Message-----
From: Larry Paque [mailto:larry@scjins.com]
Sent: Friday, November 05, 1999 12:38 PM
To: boothm@goddard.edu
Subject: RE: Cursor positioning


Thanks, Frank - that api will give me the information I need.

Before I start writing my own version of RtvFldLoc() I need to ask - are you
willing to share your code?

Larry


-----Original Message-----
From: Frank Jodat [mailto:jodat@Dakosy.DE]
Sent: Thursday, November 04, 1999 11:44 PM
To: RPG400-L@midrange.com
Subject: Re: Cursor positioning


Larry,

Larry Paque wrote:

> > Does anyone have a clean method that avoids the use of indicators?
> > Somehow determining the row/column of a named field from the display
file
> > object?  I'd hate to have to parse the source for it.

Based on a code snippet someone showed in this list I have made a procedure
called "RtvFldLoc". The main part is the "Retrieve display file description
API"
( QDFRTVFD ). This API is amazing fast.
I use it to indicate any errors in display fields. You don't need indicators
and
the
API keeps track of any change that is done to the display file.
The procedure is part of a service program that handles display file related
stuff.

Regards,
Frank Jodat

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.