Difference between revisions of "MC-Basic:WATCH"

From SoftMC-Wiki
Jump to: navigation, search
m (Added limitation of function calls)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Languages|MC-Basic:WATCH}}
 
{{MC-Basic
 
{{MC-Basic
 
|SHORT FORM=
 
|SHORT FORM=
Line 4: Line 5:
  
 
|SYNTAX=
 
|SYNTAX=
 +
Watch <expression>
 +
 
Watch ''<task name> <variable_name>''
 
Watch ''<task name> <variable_name>''
 +
  
 
|AVAILABILITY=
 
|AVAILABILITY=
Line 10: Line 14:
  
 
|DESCRIPTION=
 
|DESCRIPTION=
Sends a string to a task to send data to a prompt command.
+
There are two types of Watch command available:
 +
 +
Watch command without a task name shows the value of any expression.
 +
 
 +
Watch command with a task name only exhibits the value of global variables addressed by the task, or static variables declared within the task.
  
 
|TYPE=
 
|TYPE=
Line 28: Line 36:
  
 
|LIMITATIONS=
 
|LIMITATIONS=
The task must exist.
+
 
 +
Watch command without a task name cannot be used for function calls.
 +
 
 +
In Watch command with a task name, the task must exist and must be stopped. Global variables must be approched by the task.
  
 
|EXAMPLE=
 
|EXAMPLE=
 +
 +
common shared glob_var as long = 8
 +
 +
MyTask.Prg:
 +
 +
dim shared stat_var as double = 54.76
 +
 +
Program
 +
glob_var = 23
 +
End Program
 +
 +
 +
From every context:
 +
 +
Watch glob_var
 +
Watch sys.idn[1]
 +
 +
From MyTask.Prg:
 +
 +
Watch stat_var
 +
 +
While MyTask.prg is paused:
 +
 +
Watch MyTask1.prg stat_var
 +
 +
While MyTask.prg is paused or killed:
 +
 +
Watch MyTask1.prg glob_var
 +
 
|SEE ALSO=
 
|SEE ALSO=
 
* [[MC-Basic:SAVE|SAVE]]
 
* [[MC-Basic:SAVE|SAVE]]
  
 
}}
 
}}

Latest revision as of 10:15, 12 August 2020

Language: English  • 中文(简体)‎

There are two types of Watch command available:

Watch command without a task name shows the value of any expression.

Watch command with a task name only exhibits the value of global variables addressed by the task, or static variables declared within the task.

Syntax

Watch <expression>

Watch <task name> <variable_name>

Availability

All versions

Scope

Task or Terminal

Limitations

Watch command without a task name cannot be used for function calls.

In Watch command with a task name, the task must exist and must be stopped. Global variables must be approched by the task.

Examples

common shared glob_var as long = 8

MyTask.Prg:

dim shared stat_var as double = 54.76
Program
glob_var = 23
End Program


From every context:

Watch glob_var 
Watch sys.idn[1]

From MyTask.Prg:

Watch stat_var

While MyTask.prg is paused:

Watch MyTask1.prg stat_var

While MyTask.prg is paused or killed:

Watch MyTask1.prg glob_var

See Also