Difference between revisions of "MC-Basic:PRINTUSING hash-sign"
m (Text replace - "Versions 3.2.1 and higher" to "Since Version 3.2.1") |
|||
Line 10: | Line 10: | ||
|AVAILABILITY= | |AVAILABILITY= | ||
− | + | Since Version 3.2.1 | |
|DESCRIPTION= | |DESCRIPTION= |
Revision as of 16:50, 20 March 2014
PRINTUSING #
Prints formatted numeric variables to a serial port using the specified format <string>. The format string contains literal text to be printed as well as characters for formatting numeric expressions. Only a single formatting string (containing text and formatting characters) followed by the expressions to print is allowed.
Short form
PrintU #
Syntax
PrintUsing #<DeviceHandle>, "<format_string>"; [<expression>];{[<expression>]}*
Availability
Since Version 3.2.1
Type
<DeviceHandle>: Long <format_string>: String <expression>: Long or Double
Range
<DeviceHandle>: 1 to 255 <string>: N/A <expression>: N/A
Scope
Configuration, Task, Terminal
Limitations
Only 15 digits after the decimal point can be displayed. The statement, printu “#.################”;My_Var,
Examples
Specify a minimum number of characters to print by using the “#” sign and decimal point. B = 33.344 PrintU #1 “B is ##.##”;B ‘prints B IS 33.34
PrintU #1 “B is ##.####”;B ‘prints B IS 33.3440
PrintU #1 “B is ##.##^^^^”;B ‘prints B IS 3.33e+01