PxPlus User Forum

Twitter Twitter Twitter

Author Topic: tcb(31) in a validator  (Read 1638 times)

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
tcb(31) in a validator
« 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?

Marty

  • Member
  • **
  • Posts: 5
    • View Profile
Re: tcb(31) in a validator
« Reply #1 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$

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: tcb(31) in a validator
« Reply #2 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)

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: tcb(31) in a validator
« Reply #3 on: April 17, 2020, 10:52:00 AM »
Have you tried reading the 'Lock property?
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: tcb(31) in a validator
« Reply #4 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.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: tcb(31) in a validator
« Reply #5 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.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: tcb(31) in a validator
« Reply #6 on: April 17, 2020, 12:04:49 PM »
See? Like I suspected = more obvious/better - Thanks, Mike.