Difference between revisions of "MC-Basic:PRINT"
m |
(added link to MC-Basic:PrintPoint) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
|SYNTAX= | |SYNTAX= | ||
− | PRINT “''<String>” | + | PRINT “''<String>” ?'"`UNIQ--nowiki-00000001-QINU`"'? [Expression] {, ?'"`UNIQ--nowiki-00000002-QINU`"'? ; “<String>” ?'"`UNIQ--nowiki-00000003-QINU`"'? [Expression]'' }* {DetectOverflow = <'' Expression'' >} |
|AVAILABILITY= | |AVAILABILITY= | ||
Line 54: | Line 54: | ||
|SEE ALSO= | |SEE ALSO= | ||
− | * [[ | + | * [[MC-Basic:PRINTUSING|PRINTUSING]] |
− | * [[ | + | * [[MC-Basic:SYSTEM.PRINTMODE|SYSTEM.PRINTMODE]] |
+ | * [[MC-Basic:PRINTTOBUFF|PRINTTOBUFF]] | ||
+ | * [[MC-Basic:PRINTUSINGTOBUFF|PRINTUSINGTOBUFF]] | ||
+ | * [[MC-Basic:PrintPoint|PrintPoint]] | ||
}} | }} |
Latest revision as of 15:11, 10 November 2020
Multiple strings and expressions are printed, separated by either a comma or a semicolon. The semicolon puts the two expressions next to each other while the comma puts a tab between them. The semicolon at the end of the expression suppresses CR-LF, allowing several print statements to be concatenated. The message is printed to the output window of ControlStudio with the last print statement printed without a semicolon at the end. Variables are “watched” by simply querying them. The ControlStudio Watch window manages queries to the specified variables. Use Print “” to print an empty line. You can supress the carriage return at the end of a line by terminating PRINT with a semicolon.
The DetectOverflow parameter handles printouts that do not fit into the internal message queue (64 messages). When value is zero, these printouts are silently dropped and task is not delayed. However, if DetectOverflow is “1” and there is no free space in the print queue, task is stopped with run-time error. This optional flag defaults to Zero when not used.
Short form
?
Syntax
PRINT “<String>” ?'"`UNIQ--nowiki-00000001-QINU`"'? [Expression] {, ?'"`UNIQ--nowiki-00000002-QINU`"'? ; “<String>” ?'"`UNIQ--nowiki-00000003-QINU`"'? [Expression] }* {DetectOverflow = < Expression >}
Availability
All versions
DetectOverflow parameter: Version 4.0.5 and higher
Type
< (DetectOverflow)Expression>: Long
Range
< (DetectOverflow)Expression>: 0 or 1
Scope
Configuration, Task or Terminal
Limitations
Variables defined within a task may be queried from outside the task (for example, from the terminal) only when the task is idle. Within a task, local variables are only available if the task is idled in a section of code wherein the local variable was declared.
Examples
Print "Hello,";
Print "world."
Prints the following:
Hello, world.
Common shared Message as string
Try
Print Message
Catch 8036 ‘ Entry Station output buffer overflow.
End Try