'=========================================================================== ' Subject: USING GET & PUT Date: 08-02-96 (14:43) ' Author: Kurt Kuzba Code: QB, QBasic, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== '> Can any one help me with the statements GET adn PUT? In '> screen mode 13? Does anyone know how to display a sprite '> that is made with Sprite Editor and is appended into a '> QBasic program using the DATA statement? What it does is '> put a sprite that you draw in Sprite Editor in QBasic using '> DATA statements?? I don't get it??? '>..................................... ' GET and PUT in mode 13 is simple. You can actually work with 'the data in your array, unlike with mode 12. I have yet to make 'heads or tails of the array data arrived at with the GET in 12. 'You require one byte for each pixel, plus four bytes to hold the 'block format data, which is two integer values, one for the width, 'and one for the height, of the graphical block. Try this: SCREEN 13 DIM BUF(602) AS INTEGER '(40x30 + 4 bytes for format data) / 2 BUF(0) = 320 'set block width (in BITS!) 40 * 8 BUF(1) = 30 'set block height DEF SEG = VARSEG(BUF(0)): O& = VARPTR(BUF(0)) + 4 'set segment to directly manipulate BUF DO Colour% = RND * 255 FOR T& = O& TO O& + 1199: POKE T&, Colour%: NEXT 'set BUF contents to another color at random X% = RND * 279: Y% = RND * 169 'Pick a random screen location. IF (Colour% AND 1) <> 0 THEN 'This IF/THEN/ELSE is just for PUT (X%, Y%), BUF, PSET 'fun, alternating between the ELSE 'absolute PSET usage and the PUT (X%, Y%), BUF, XOR 'XOR, combining present image END IF 'with the imposed image. It IF INKEY$ <> "" THEN EXIT DO 'makes the display just a bit LOOP 'more interesting to watch SCREEN 0: WIDTH 80, 25: END 'go back to 80x25 text and end.