Qbasicnews.com
April 09, 2020, 05:53:48 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: having problem with get and put  (Read 1271 times)
shuango
New Member

Posts: 8


« on: March 26, 2003, 03:53:03 PM »

i am working with a ending screen! my teacher requires to use get and put, but i can't do it.
following is my ending screen:

rem use get and put  to make a ending screen
cls
screen 7
randomize timer
top:x=int(rnd*300)+10
y=int(rnd*200)+10
for a=1 to 1000
print " the                                                                           end"
pset (150,200), int(rnd*16)+1
for r=0 to 360
draw "ta" + str$(r) + "nr100"
rem for dd=1 to 100000:next dd
next r,a
Logged
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #1 on: March 28, 2003, 01:45:56 PM »

this ( Smiley ), but here goes.  First, why are you doing

PSET(150,200)... ?

The maximum vertical pixel position you can use in mode 7 is 199.  The screen dimensions are 320 x 200 and positions are 0-based.

Continuing, after you have your picture on your screen, you save it to an array using GET.  You first need to define the array.  It needs to have 32,004 bytes.  That's 16,002 INTEGER elements or 8,001 LONG ones.  Using LONG ones might help avoid having to make the array dynamic (not that it matters):


DIM MYPICT(1 TO 8001) AS LONG


Now copy the video data to the array MYPICT:


GET (0,0) - (319,199), MYPICT


You can now clear your screen, switch video modes, whatever.  To redisplay the picture, reset the video mode (if necessary) and use PUT:


SCREEN 7
PUT (0,0), MYPICT, PSET


(If the screen's clear, you don't need the PSET "action verb.")  Look up GET and PUT in the on-line help (press ALT-H from within the IDE) for more general uses of GET and PUT to work with smaller portions of the screen and position smaller pictures anywhere you want, not necessarily with their upper lefthand corner at the upper lefthand corner of the screen.
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!