A SERVICE OF

logo

Programming 3 – 25
Example:
Suppose you want to print 400 columns of graphics:
n2 = 1
256 400
256
n1 = 144
If you want to print in single density graphics mode, the beginning of
your statement should look like this:
LPRINT CHR$(27);CHR$(75);CHR$(144);CHR$(1)
n2
n1
ESC K
IBM BASIC includes two functions that make calculating nl and n2 very
easy:
MOD divides two numbers and returns the integer remainder,
FIX removes the fractional portion of a numeric expression without
rounding it off.
See your BASIC Manual for details.
Using these functions, you can express our sample numbers this way:
10 NDOTS = 400
20 LPRINT CHR$(27);CHR$(75);CHR$(NDOTS MOD 256);
CHR$(FIX(NDOTS/256))
Note: The number of dot columns expressed by n1 and n2 cannot be greater than the
maximum number of dot columns per line allowed for the graphics mode you are using
(see table below).