Task Suffix of Main Program


JK Heydt
 

Thank you! CtxGetName() = ‘Main’ works like a charm.


Steven Burrows
 

Similarly…

Condition your call on :

CtxGetName() = ‘Main’

 

Steven Burrows

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Frederik Soete via groups.io
Sent: 11 September 2022 14:05
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Task Suffix of Main Program

 

This email is not from Hexagon’s Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email.

 

Hi,

 

Just a guess... Have you tried checking CtxNum()? I guess the very last task suffix will have value 1, all other task suffixes would have a larger value.

Op zo 11 sep. 2022 14:49 schreef JK Heydt <john@...>:

I want to log when a user exits the program, but the task suffix of the main program runs every time a parallel program terminates, and again when the system terminates. How can I capture when the system terminates? I've tried Level() and TDepth() but they don't seem to help.

Thanks!
John H


Frederik Soete
 

Hi,

Just a guess... Have you tried checking CtxNum()? I guess the very last task suffix will have value 1, all other task suffixes would have a larger value.

Op zo 11 sep. 2022 14:49 schreef JK Heydt <john@...>:

I want to log when a user exits the program, but the task suffix of the main program runs every time a parallel program terminates, and again when the system terminates. How can I capture when the system terminates? I've tried Level() and TDepth() but they don't seem to help.

Thanks!
John H


JK Heydt
 

and... capturing the event "Close Application" on any scope doesn't seem to work either. Nothing happens when in the main program.


JK Heydt
 

I want to log when a user exits the program, but the task suffix of the main program runs every time a parallel program terminates, and again when the system terminates. How can I capture when the system terminates? I've tried Level() and TDepth() but they don't seem to help.

Thanks!
John H