Print Line Buffer Operation - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

i96
TAB Function
The TAB (expression) function allows you to align columns of data. When (expres-
sion) is a non-integer, it is truncated. Thus, TAB(n) starts the next output in column
n of the line. If the current position in the line is greater than n, data is put on the
next line in position n. TAB(n) can be followed by a comma or semicolon with the
same result. If n is greater than the line length, data is put at position X after
computation of the following, where n
=
the TAB expression and L
=
line length:
x
=
n-L *INT((n-1)/L)
For example, if line length
=
64 and the TAB(n)
=
70, the integer value
((70-1 )/64)
=:
1 is multiplied by 6(70-64). Thus, output begins in position 6 of the
next line. This formula only applies where L
=
1 to 9999.
Print Line Buffer Operation
The print line buffer is a temporary storage location where the characters for each
print line are placed. After all data for a print line has been placed in the buffer, the
data line is printed.
A buffer-position pointer is used to keep track of the next available position where
a character (or digit) can be placed in the buffer. The movement of the buffer-position
pointer before, during, and after moving an expression into the buffer depends on
the type of expression to be printed and the delimiter following it in the PRINT
statement.
The position of the buffer-position pointer can be moved forward by using the TAB
function. See the PRINT statement examples that follow.
The following examples show how various arithmetic values would be printed or
displayed. The symbol 16 represents a blank character, which always appears in the
sign position of a positive number.
Value Given
Value Printed
0123
16123
00123
16123
-1234.5
-1234.5
135999999999
16135999999999
Note About PRINT
If there is no printer attached to the 5100, executing the PRINT FLP statement
stops the pr9gram unless the P
=
0 (printer
=
display) option was specified in the
RUN command.
/
\
.~.

Advertisement

Table of Contents
loading

Table of Contents