beautypg.com

Rpbasic-52 programming guide, Print print #, p – Remote Processing BASIC 52 User Manual

Page 108

background image

RPBASIC-52 PROGRAMMING GUIDE

2-89

PRINT
PRINT #,
P.
?

Syntax:

PRINT expr
P. expr
? expr
PRINT#port,expr
P.# port,expr
?#port,expr
Where: expr = any string, mathematical number, or calculation

port = serial output port 0 or 1. Your card may have m ore ports.

Function:

Prints value of expr to a serial port

Mode:

Comm and, run

Use:

PRINT "String",$(0),AIN(0)*.00214

Cards:

PRINT#, P.#, and ?# only on RPC-320, RPC-330.

D E S C R IP T I ON

PRINT is used to send serial data to any port. Default is COM 0. Use port o r U O to r e- d ir e ct o ut p ut t o C O M
1 or others.

If there is no expr, a carria ge retu rn - line fe ed com binatio n is sen t. expr is any combination of
instructions/operators and variables, strings, or literal values. More than one expr may be output by
separating them with commas. Values are printed with a leading and trailing space; a list of positive values
separated by commas will thus print with two intervening blanks. A "+" is implied. The "-" symbol precedes
negative values and takes the place of the normal preceding space. Strings and literals are output with no
added blanks. If a comma is the last character in the list then the normal is suppressed.

The shorthan d versions P. and ? are converted to PRINT after each program line is entered, so a P. or ? is
neve r listed.

The PRINT#port, instruction functions exactly like the PRINT instruction, but it directs output to the
designated serial port. When using this syntax, any output directed by the UO comm and is bypassed.

P.# and ?# are shorthand for PRINT#.

RELATED U O , C O N F IG B A U D

EXAMPLE

100 STRING 200,20 : $(0)="String" : B=PI*5
110 PRINT $(0),B,AIN(0)*.00215

>run

String 15.707963 0