PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: ChrisKCAi on April 16, 2020, 05:24:31 PM

Title: tcb(31) in a validator
Post by: ChrisKCAi on April 16, 2020, 05:24:31 PM
If user is in a multi-line that has a validator program associated with and the hits a terminator key [Enter], [F2],[F3], etc. can I rely on tcb(31) to return the value of the multi-line control inside the validator program? Is there a better way to determine that?
Title: Re: tcb(31) in a validator
Post by: Marty on April 16, 2020, 06:02:29 PM
You really shouldn't do anything with the control. You get the "User Defined Tag field" and the value. You can return an error if the value is invalid. You would process the error in the control when it is returned. Here is what the enter is: ENTER IN_DT$,ERR_MSG$,TAG$,OLD_VAL$,EOM_VAL$
Title: Re: tcb(31) in a validator
Post by: ChrisKCAi on April 17, 2020, 10:19:07 AM
Specific use case is that I want to know if the multi-line is locked when the user presses a function key (and fires off the validator program)
Title: Re: tcb(31) in a validator
Post by: Mike King on April 17, 2020, 10:52:00 AM
Have you tried reading the 'Lock property?
Title: Re: tcb(31) in a validator
Post by: ChrisKCAi on April 17, 2020, 11:14:57 AM
That's what I want to examine ('lock) so hence my question - how do I determine the control value inside the validator? Since the validator is CALLed, is there a Nomads global or %NOMADS property I can use? I was going to try tcb(31) (seems to work in my prelim testing) but I feel I might be missing something more obvious/better.
Title: Re: tcb(31) in a validator
Post by: Mike King on April 17, 2020, 11:30:22 AM
The Validator is called because the control generated an On Change signal which is detected by the CTL value.  This means the validation logic should be able to use the value returned from CTL as the handle to the control.
Title: Re: tcb(31) in a validator
Post by: ChrisKCAi on April 17, 2020, 12:04:49 PM
See? Like I suspected = more obvious/better - Thanks, Mike.