|Syntax||PAINT x, y, col, bufadr, buflen|
The command PAINT addresses the screen directly and fills a closed figure with the colour col (which must be in the range 0..4, see SET).
The command requires a buffer of at least 4K whose start address is passed to PAINT as bufadr and whose length as buflen (which must be a minimum of 4096 bytes). The larger the buffer, the better, but very large buffers (say, 100K) seem to confuse PAINT and will make it stop before it has finished - therefore keep the buffer below 32K.
100 WINDOW 512,256,0,0: BORDER 1,3: PAPER 0: CLS 110 buflen = 10240 120 : 130 FOR i = 1 TO 15 140 LDRAW RND(511),RND(255) TO RND(511),RND(255), 3 150 END FOR i 160 : 170 buffer = ALCHP(buflen) 180 PAINT RND(1 TO 510), RND(1 TO 255), 2, buffer, buflen 190 RECHP buffer
A spectacular crash!
See those at SET.
PAINT will crash the machine if it runs out of the screen, so you have to ensure that the figure to be filled is closed. Another means of protection is to use a BORDER, as in the example.