Movement to a Persistent Field Via Program Logic

Discussions about CSEntry
Post Reply
rkingcso
Posts: 6
Joined: February 1st, 2013, 10:40 am

Movement to a Persistent Field Via Program Logic

Post by rkingcso »

Hello,

Is there any way to programatically move a cursor to a specific Persistent Field? At present, the application requires the user to press the F7 key repeatedly.

I would like to use the OnKey function to remap a keystroke to clear the values in the entire set of Persistent Fields and to place the cursor at the FIRST one.

The function successfully clears the values. However, it places the cursor at the LAST Persistent Field; since the "Move" statement does not seem to work with Persistent Fields, the user then has to press the F7 key to navigate through each of the previous Persistent Fields in order to start data entry from the beginning.

I will appreciate any guidance you can give.

Thank you.

Rachel
Gregory Martin
Posts: 1812
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Movement to a Persistent Field Via Program Logic

Post by Gregory Martin »

As far as I know there is no way to do this. If you change your move statement to a reenter statement, you'll see that CSPro won't even let you compile your application, as persistent fields aren't meant to be reentered in the same way that other fields are.

"REENTER target cannot be a persistent field"

One workaround would be to create a temporary record with some working variables that duplicate your ID variables. The keyer will enter the IDs into these fields, which you can reenter, and you'll copy over these values to the real persistent IDs, which the keyer will never modify.

See attached for a sample application that does this.
Attachments
persistentTest.7z
(1.66 KiB) Downloaded 375 times
rkingcso
Posts: 6
Joined: February 1st, 2013, 10:40 am

Re: Movement to a Persistent Field Via Program Logic

Post by rkingcso »

Thanks Gregory,

I had previously tried the reenter statement and realized that the code could not compile. So I appreciate the work around solution.

My application now works as desired, I just had to add code to the OnKey function to 'unprotect' the pseudo ID fields AND keep the values; so that the user can easily 'modify' the existing ID values if necessary.

Thanks again,

Rachel
Post Reply