Difference between revisions of "MC-Basic:PROGRAMCONTEXT"

From SoftMC-Wiki
Jump to: navigation, search
Line 67: Line 67:
 
* [[MC-Basic:PROGRAMNAME|PROGRAMNAME]]
 
* [[MC-Basic:PROGRAMNAME|PROGRAMNAME]]
  
[[Category:Axystems:MC-Basic:Task Control|PROGRAMCONTEXT]]
+
[[Category:MC-Basic:Task Control|PROGRAMCONTEXT]]
 
}}
 
}}

Revision as of 09:17, 22 May 2014

This query returns a Long value, indicating the context of the querying task. ProgramContext can only be used for the querying task, and cannot refer to another task

1: Terminal

2: Configuration file

3: User task block (with “PRG” extension)

4: Event block

5: Event condition                                                                                                       6: OnSystemError block                                                                                                  7: OnError block                                                                                                     8: Recorder

Syntax

?PROGRAMCONTEXT

Availability

Version 3.3 and above.

Type

Long

Range

1 to 8

Scope

Configuration, Task or Terminal

Limitations

Read Only.

Examples

From Terminal:

-->?ProgramContext            ‘ Should return 1


Or within Task1.prg :

Program

? ProgramContext          ‘ Should return 3

Onevent Event1 ProgramContext = 5

? ProgramContext  ‘ Should return 4

End Onevent

Eventon Event1

End Program

See Also