MC-Basic:PRINTUSING hash-sign

From SoftMC-Wiki
Jump to: navigation, search
Language: English  • 中文(简体)‎

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

See Also