
RPBASIC-52 PROGRAMMING GUIDE
2-30
DISPLAY
Syntax: DISPLAY 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 and turns it on or off
data Puts data values to display
CR Prints a carriage return to the display
LINE Puts a line to a graphics display
P Puts a point to a graphics display
ON [G,C] Enables character, graphic, or both displays
OFF [G,C] Turns off character, graphic, or both displays
Function: Writes information to display.
Mode: Command, Run
Use: DISPLAY (1,2,OFF),28,"Name: ",$(0)
Cards: All
DESCRIPTION
DISPLAY has many options, some of which cannot be used with all displays. Graphics commands (LINE, P,
C, and G) are only valid with the LCD -5003. An error is returned when they are used with character only
displays.
Strings and cursor positioning may be placed in any order on the comm 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 positioned at line 1, first position (0) and the cursor is turned on. The string "Batch 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 cursor is positioned just after the ':' character.
DISPLAY does not format text like PRINT. SPC, TAB, and USING commands return an error. Use STR
function 10 to format numbers.
NOTE: Unlike the PRIN T com mand and serial po rts, DISPLA Y doe s not buffer sending data to th e displ ay.
Due to display speed lim itations, it may take up to 1 m s to write 1 character or data point to a scree n.
Long strings or lines may take several milli-seconds. Time sensitive interrupts, such as ONTICK,
can be "missed" if printing is long an d the tick interval is very short. In these situations, it is best to
break up any DISPLAY 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)
Komentarze do niniejszej Instrukcji