How To get The Cursor position on particular field?

185 pts.
Tags:
AS/400
Cursor operation
DSPF
RPG
RPGLE
My display File Contains three Fields as like

name= ........

 Roll =........

 Marks=.......

 But In that Case when Program Call, First Cursor Pos On name When Name Will Enter Roll No will Automaticalyy Disply. But I have To Modify Marks Field,,, So When I will Enter Name After That I want To cursor On Mark Field So how can i do this? (In Dislpay File Any Keyword for cursor plz mention in detail )

Answer Wiki

Thanks. We'll let you know when a new response is added.

The display attribute DSPATR(PC) position cursor might be what you’re after
It would be placed as a keyword for the input field, on the same line as the input field

If you want to be able to turn it on/off put it on a line after the field with an indicator
45 DSPATR(PC)
when 45 is set on in your program the cursor will be shown in this field.
Phil

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Splat
    Another option would be to use the following:
    A                                      CSRLOC(ROW        COLUMN)
    A                                      RTNCSRLOC(&FORMAT &FIELD)
    A            ROW            3S 0H                               
    A            COLUMN         3S 0H                               
    A            FORMAT        10A  H                               
    A            FIELD         10A  H
    You don't need to keep track of indicators.
    10,235 pointsBadges:
    report
  • Djonises

    @Splat. How to "send" the cursor to a field, without using indicator?(lets say you have like 50+ fields).

    With your given method you cant do that. RTNCSRLOC is only for retrieving the field position and not setting the field position. CSRLOC is for setting the position but still you need to know the screen (x,y) values (almost impossible in a movable window).

    10 pointsBadges:
    report
  • ToddN2000
    When it comes to having that many fields that require you keep track of the cursor position it may be worth looking at other alternatives. Write a web application that access the DB2 data or try and break down the processing into smaller sections. There are just some thing that cannot be done due to the limits or RPG/ILE.

    63,110 pointsBadges:
    report
  • GregManzo
    Actually, the RPG *language* isn't the problem. The limits are imposed by the ugly green-screen display and the 5250 data stream. But still, a web display avoids that.
    835 pointsBadges:
    report
  • ToddN2000
    Your right GregManzo, RPG and CL have come a long ways since I started coding in them back in 1980. It's the DDS and terminal emulators that has not kept up with today's needs. Limiting displays to certain screen sizes 24x80 or 27x132 is outdated. I don't think I know of anyone still using a dumb CRT type terminal.
    63,110 pointsBadges:
    report
  • Splat
    Djonises, take a look at the workstation INFDS, particularly the cursor location from 370 to 371 (binary). Executing row = %div(cursor: 256) and column = %rem(cursor: 256) gives you the exact location of the cursor on the screen.
    I should have included that in my earlier response.
10,235 pointsBadges:
report
  • Splat
    ToddN2000, I'd still kill for a 5250 model 11. Best keyboard ever.
    10,235 pointsBadges:
    report
  • Forgot Password

    No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

    Your password has been sent to:

    To follow this tag...

    There was an error processing your information. Please try again later.

    Thanks! We'll email you when relevant content is added and updated.

    Following

    Share this item with your network: