PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Checking if 'Fired Off From' Nomads  (Read 2121 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 188
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Checking if 'Fired Off From' Nomads
« on: July 14, 2023, 09:17:23 AM »
Hi All,

So often times we will gosub or perform a routine that is also the code behind a multi-line. For Example CUSTOMER_ID_ENTERED. 

When we want to know if this came from nomads or from code we check ID$="CUSTOMER_ID".
I know it may seem like I'm splitting hairs but i feel this is not 100% foolproof and i have case where I really need to know (was this routine fired off from Nomads via the multi-line)

is there a way i can be 100% sure?

thanks

jeff

Mike King

  • Diamond Member
  • *****
  • Posts: 3830
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Checking if 'Fired Off From' Nomads
« Reply #1 on: July 14, 2023, 10:12:49 AM »
Jeff

You likely could use TCB( 8 ) to see if there is anything on the GOSUB stack since if the routine is PERFORMED then the GOSUB stack will be empty.

Code: [Select]
0010 GOSUB test
0020 PERFORM PGN+";test"
0030 GOSUB test2
0040 END
0050 !
0060 test2:
0070 PERFORM PGN+";test"
0080 RETURN
0090 test:
0100 PRINT "TCB ( 8 )=",TCB(8)
0110 RETURN

-:run
TCB ( 8 )= 20
TCB ( 8 )= 0
TCB ( 8 )= 0
-:

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 188
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: Checking if 'Fired Off From' Nomads
« Reply #2 on: July 14, 2023, 10:17:44 AM »
Mike that is perfect ...thank you...