beautypg.com

Rpbasic-52 programming guide, Display – Remote Processing BASIC 52 User Manual

Page 49

background image

RPBASIC-52 PROGRAMMING GUIDE

2-30

DISPLAY

Syntax:

D I S P LA Y option[,option][,option]
Where: option is one or more of the following

"string"

Prints to display

$(n)

Prints to display

(row,col[,cursor])

Positions cursor an d turns it on or off

data

Puts data values to display

C R

Prints a carriage return to the display

L I N E

Puts a line to a graphics display

P

Puts a point to a graphics display

O N [ G ,C ]

Enables character, graphic, or both displays

O F F [ G ,C ]

Turns off character, graphic, or both displays

Function:

Writes information to display.

Mode:

Comm and, Run

Use:

DISPLAY (1,2,OFF),28,"Name: ",$(0)

Cards:

All

D E S C R IP T I ON

DISPLAY has many options, some of which cannot be used with all displays. Graphics commands (LINE, P,
C, and G) a re only valid w ith the LCD -5003. An error is returne d when the y are used w ith character only
displays.

Strings and curso r positioning ma y be placed in any order on the c omm and line with the exception of data .
The following example shows how some options can be combined in a program line.

100 DISPLAY (1,0,ON),"Batch no.: ",$(0),(2,0),"Enter process no.:"

The cursor is po sitioned at line 1, first position (0) and the cursor is turned on . The string "Ba tch no.: " is
printed. The string in $(0) is then printed. The cursor is then re-positioned to line 2 (third line down), first
position. The string "E nter process no.:" is then printed. The curso r is positioned just after the ':' characte r.

DISPLAY does not format text like PRINT. SPC, TAB, and USING commands return an error. Use STR
function 10 to format numbers.

NOTE: Unlik e the P RIN T com man d and s erial po rts, DIS PLA Y doe s not bu ffer sen ding d ata to th e displ ay.

Due to displ ay spe ed lim itation s, it ma y take up to 1 m s to wr ite 1 ch aracte r or data point to a scree n.
L o n g s t ri n gs o r l i ne s m a y t a ke s e ve r al m i ll i -s e c on d s . T i m e se n s it i ve i nt e rr u pt s , s u c h a s O N T IC K ,
can be "m issed" if printing is long an d the tick interval is very short. In these situations, it is best to
break up any DISPL AY com mand into smaller sizes.

The following paragraphs explain each display option.

"string" is any quoted text used in PRINT statements.

DISPLAY "Hello world"

$(n) is any string array. Variable numbers must be printed from this array. The program in TIME function
shows how to convert a number into a string.

DISPLAY $(0)