PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: Jeffrey Ferreira on July 14, 2023, 09:17:23 AM

Title: Checking if 'Fired Off From' Nomads
Post by: Jeffrey Ferreira 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
Title: Re: Checking if 'Fired Off From' Nomads
Post by: Mike King 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
-:

Title: Re: Checking if 'Fired Off From' Nomads
Post by: Jeffrey Ferreira on July 14, 2023, 10:17:44 AM
Mike that is perfect ...thank you...