HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

4-: 23
*
num_chars
evaluates to a positive value;
num_chars
characters are set
to the specified enhancement one character at a time. Each of the
individual characters is prefixed with the appropriate escape
sequence required for the enhancement. The escape sequence prefixing
the character following the last character to be enhanced contains
the enhancement terminator.
*
num_chars
evaluates to zero; the escape characters that turn on the
specified enhancement prefix the characters at the current cursor
position. The enhancement is terminated as follows. If there is an
enhancement on the line at a point following the current cursor
position then that enhancement terminates the specified enhancement.
Otherwise, the specified enhancement extends only to (and including)
the last non-blank character on the line.
*
num_chars
evaluates to a negative value; the character at the current
cursor position is prefixed with the escape sequence for the
specified enhancement. The character at the position in screen
memory that is
num_chars
to the right of the current cursor position
is followed by the enhancement terminator.
The enhancement terminator causes the next character to not have
enhancements. This may cause strange results when putting an
enhancement on a line with existing enhancements. Enhancements that
go past the end of the line may also cause some strange results.
Thus, characters between the current cursor position and the
enhancement terminator are not individually enhanced.
For example, 'CURSOR (,1),("HI",50)' performs exactly the same
function as 'CURSOR (,1),("HI",-50)' if, in the latter case, the
current line contains no enhancement terminators. Execution of the
second statement is faster.
The use of positive and non-positive enhancement lengths intermixed on a
single screen produces unpredictable results. Therefore, we do not
recommend this.
Examples
10 DISP '27"H"'27"J";
20 OPEN FORM "main:jfmain" !Simple form with five 18 character fields
30 FOR I = 1 TO 5 !Start output to each field
40 PRINT RPT$(VAL$(I),3) !Set fld1 to 111, fld2 to 222, etc
50 NEXT I
60 CURSOR IFLD(4) !Positions the cursor to the fourth field
70 INPUT A$ !a carriage return here will read 444
71 !into A$ and increment IFLD(x) to the fifth field
80 CURSOR CFLD(1) !Positions the cursor to the first field
81 !on the form
90 INPUT B$ !A carriage return here will read 555
91 !into B$, not the 111 from the first field
92 !The first field is where the cursor is
93 !located when the carriage return was pressed
95 CURSOR SETIFD(2),SETCFLD(2) !Sets the cursor and input pointers
96 !to the second field, but does not move
97 !the cursor
98 INPUT C$ !The cursor is now moved to the cursor
!field specified in line 95 and reads
99 !the contents of the current input
100 !field into C$
101 CURSOR SETIFLD(5) !Sets the input field to field 5
102 ENTER D$ !Reads the contents of input field
103 ! 5 into D$
105 CLOSE FORM;REMAIN
110 PRINT A$,LIN(1),B$ !A$=444, B$=555
999 END
DATA
The DATA statement lists data for the READ statement. The data that the
DATA statement provides is assigned to variables by the READ statement.