Set Cursor dynamicly

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
m400mail
New User
Posts: 13
Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:

Set Cursor dynamicly

Post by m400mail »

Hello to all

if there a way to set the Cursor dynamicly by a Field Name ?

For example RPG Code
select;

// Prompt / F4 bei welchem Feld

when currec='SCREEN02' and CURFLD='HDKDNR1' and prompt1 = *on;
dsply 'Prompt Kundennummer1 ' ;
// set cursor into Field HDKDNR1
when currec='SCREEN02' and CURFLD='HDKDNR2' and prompt2 = *on;
dsply 'Prompt Kundennummer2 ' ;
// set cursor into Field HDKDNR2

when currec='SCREEN02' and CURFLD='HDKDNR3' and prompt3 = *on;
dsply 'Prompt Kundennummer3 ' ;
// set cursor into Field HDKDNR3

Endsl;
Attachments
profound.docx
(28.37 KiB) Downloaded 147 times
Theju112
Profound User
Posts: 48
Joined: Fri Jul 10, 2020 8:35 am
First Name: Thej
Last Name: Pav
Company Name: Confidential
Phone: 00918310800134
Address 1: Chennai
Address 2: India
City: Chennai
State / Province: Outside Canada/USA
Zip / Postal Code: 673592
Country: India
Contact:

Re: Set Cursor dynamicly

Post by Theju112 »

Well I would use an indicator to condition the DSPATR(PC) attribute associated to the field and turn it on to position the cursor whenever the condition is satisfied.

Please note, I am just a profound user. Somebody from profound might be able to offer better advice.

More details in below link:

https://www.ibm.com/support/knowledgece ... fdspat.htm
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Set Cursor dynamicly

Post by Scott Klement »

If I understand correctly, you want to set focus on a different field depending on a condition in your RPG program.

The easiest way to do that is to bind indicators to the "set focus" property of each text box. (This is similar to DSPATR(PC), but for a Rich Display, whereas DSPATR is for a green-screen display.)
Theju112
Profound User
Posts: 48
Joined: Fri Jul 10, 2020 8:35 am
First Name: Thej
Last Name: Pav
Company Name: Confidential
Phone: 00918310800134
Address 1: Chennai
Address 2: India
City: Chennai
State / Province: Outside Canada/USA
Zip / Postal Code: 673592
Country: India
Contact:

Re: Set Cursor dynamicly

Post by Theju112 »

Aaah.. totally missed out on the rich display part, yup, as Scott corrected me, we would need to bind the set focus property to an indicator.
Hope I got it correct his time around.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests