Page 1 of 1

Rexx Panel - Cursor

PostPosted: Tue Mar 22, 2011 1:34 am
by Richard Pearl
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"

Re: Rexx Panel - Cursor

PostPosted: Tue Mar 22, 2011 1:41 am
by prino
Richard Pearl wrote:Rexx panels working fine.

REXX panels do not exist! Use correct terminology!

Re: Rexx Panel - Cursor

PostPosted: Tue Mar 22, 2011 1:49 am
by Richard Pearl
Good Afternoon,
My Rexx program (which displays a panel) is working fine....

- Thank you for the correction.

Re: Rexx Panel - Cursor

PostPosted: Tue Mar 22, 2011 5:03 am
by prino
Now, if you could post, in
[code][/code]
tags, your entire panel, then we would have something to work with...

Re: Rexx Panel - Cursor

PostPosted: Tue Mar 22, 2011 5:48 am
by Pedro
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

Re: Rexx Panel - Cursor

PostPosted: Wed Mar 23, 2011 8:52 pm
by Richard Pearl
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"

Re: Rexx Panel - Cursor

PostPosted: Wed Mar 23, 2011 9:19 pm
by prino
From one of my execs:
do until rc \= 0
  "ispexec display panel("moi") msg(isrz001) cursor("cursor")"
end

Re: Rexx Panel - Cursor

PostPosted: Thu Mar 24, 2011 1:16 am
by Richard Pearl
Still no luck - sent you entire program 75 lines code.
Thanks for help.

Re: Rexx Panel - Cursor

PostPosted: Thu Mar 24, 2011 7:50 pm
by Pedro
)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.

Re: Rexx Panel - Cursor

PostPosted: Thu Mar 24, 2011 9:41 pm
by Richard Pearl
Eureka ! It worked !
Big THANK YOU Pedro - have a great day.