Rexx Panel - Cursor



IBM's Command List programming language & Restructured Extended Executor

Rexx Panel - Cursor

Postby Richard Pearl » Tue Mar 22, 2011 1:34 am

Good Afternoon.
Rexx panels working fine. When panel loads, the Cursor starts wherever it has been defined.
Question: Is it possible to set the Cursor starting position, based on a condition ?
When I execute the code below, the value of B1 changes (Field1 or Field2) onscreen, however,
the actual blinking Cursor always stays on the topmost screen field.
- Thank you for your help.

)ATTR
)INIT"
VGET (A1 B1 Field1 Field2) PROFILE "
)PROC"
IF (&A1 = TEST)"
.CURSOR = Field1"
&B1 = .CURSOR"
IF (&A1 ¬= TEST)"
.CURSOR = Field2"
&B1 = .CURSOR"
VPUT (A1 B1 Field1 Field2) PROFILE "
&PFKEY = .PFKEY"
)END"
Richard Pearl
 
Posts: 5
Joined: Tue Mar 22, 2011 1:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx Panel - Cursor

Postby prino » Tue Mar 22, 2011 1:41 am

Richard Pearl wrote:Rexx panels working fine.

REXX panels do not exist! Use correct terminology!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Rexx Panel - Cursor

Postby Richard Pearl » Tue Mar 22, 2011 1:49 am

Good Afternoon,
My Rexx program (which displays a panel) is working fine....

- Thank you for the correction.
Richard Pearl
 
Posts: 5
Joined: Tue Mar 22, 2011 1:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx Panel - Cursor

Postby prino » Tue Mar 22, 2011 5:03 am

Now, if you could post, in
[code][/code]
tags, your entire panel, then we would have something to work with...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Rexx Panel - Cursor

Postby Pedro » Tue Mar 22, 2011 5:48 am

1. Use )INIT section to decide stuff before the screen gets displayed.
2. Use )PROC section to do stuff after the user presses action key.

So, move your .cursor statement to )INIT
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Rexx Panel - Cursor

Postby Richard Pearl » Wed Mar 23, 2011 8:52 pm

I had tried that, but it does not work either.
The value of .cursor does change correctly, because field B1 displays the cursor value onscreen.
However, the cursor itself does not move to a different location onscreen.
In other words - the value for B1 may show "Field1", but the cursor is still on "Field2".

Thank you.
")ATTR"                 
")BODY WINDOW(76,22)"               
"+                 +_field1+"       
"+ Type 'Test'  %==>_field2+"       
"+ _B1            "                 
"%PF3@EXIT"                         
")INIT"                             
"  &ZWINTTL=  'CURSOR TEST'"         
"  .CURSOR = field1"                 
"  VGET (field1 field2 B1) PROFILE "
")PROC"                             
"  IF (&field2 = TEST)"             
"     .CURSOR = field1"             
"     &B1 = .CURSOR"                 
"  IF (&field2 ¬= TEST)"             
"     .CURSOR = field2"             
"     &B1 = .CURSOR"                 
"  VPUT (field1 field2 B1) PROFILE "
"  &PFKEY = .PFKEY"                 
")END"
Richard Pearl
 
Posts: 5
Joined: Tue Mar 22, 2011 1:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx Panel - Cursor

Postby prino » Wed Mar 23, 2011 9:19 pm

From one of my execs:
do until rc \= 0
  "ispexec display panel("moi") msg(isrz001) cursor("cursor")"
end
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Rexx Panel - Cursor

Postby Richard Pearl » Thu Mar 24, 2011 1:16 am

Still no luck - sent you entire program 75 lines code.
Thanks for help.
Richard Pearl
 
Posts: 5
Joined: Tue Mar 22, 2011 1:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx Panel - Cursor

Postby Pedro » Thu Mar 24, 2011 7:50 pm

)INIT                           
  &ZWINTTL=  'CURSOR TEST'       
  .CURSOR = field1


Instead of setting to a constant value, use a variable instead.
IF &mycsr = &z
    &mycsr = 'FIELD1'
.CURSOR = &mycsr

and in the )PROC section, decide what to set &mycsr to.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Rexx Panel - Cursor

Postby Richard Pearl » Thu Mar 24, 2011 9:41 pm

Eureka ! It worked !
Big THANK YOU Pedro - have a great day.
Richard Pearl
 
Posts: 5
Joined: Tue Mar 22, 2011 1:18 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post