Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
everything crashes
#1
apparently, i cant fucking code anything in any language without everything crashing

i try to use the stupid multikey library i downloaded and it crashes... it didnt before... wtf happened?

ok fine, moving on... i try to use BLOAD/BSAVE/GET/PUT and it fucking still crashes... thats just stupidly retarded.

im taking a goddamn break
earn.
Reply
#2
let me see your code. i can't really do anything without it, as that library works in most situations.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#3
forget about the key program for now, its experimental... what im most concerned about is why after 2 times of running this program, if i run it once more, it closes Qbasic altogether with no warnnig!

Code:
DECLARE SUB SaveImage (x1 AS INTEGER, y1 AS INTEGER, x2 AS INTEGER, y2 AS INTEGER, file AS STRING)
DECLARE SUB LoadImage (dimx AS INTEGER, dimy AS INTEGER, file AS STRING, image() AS INTEGER)

DIM image(0) AS INTEGER

SCREEN 13
CALL LoadImage(16, 20, "image1.put", image())

SLEEP

FOR x = 0 TO 19
    FOR y = 0 TO 9
        PUT (x * 16, y * 20), image, PSET
    NEXT y
NEXT x

SLEEP

SUB LoadImage (dimx AS INTEGER, dimy AS INTEGER, file AS STRING, image() AS INTEGER)
    DEF SEG = VARSEG(image(0))
    BLOAD file, VARPTR(image(0))
    DEF SEG
END SUB

SUB SaveImage (x1 AS INTEGER, y1 AS INTEGER, x2 AS INTEGER, y2 AS INTEGER, file AS STRING)
    xl = (x2 - x1) + 1
    yl = (y2 - y1) + 1
    d = ((xl * yl) + 4)
    DIM a(d \ 2 - 1) AS INTEGER
    GET (x1, y1)-(x2, y2), a
    DEF SEG = VARSEG(a(0))
    BSAVE file, VARPTR(a(0)), d
    DEF SEG
END SUB

where "image1.put" is a valid .put file of 16x20 res
earn.
Reply
#4
you need more subscripts in your image() array. 2 bytes ain't gonna hold a 16x20 sprite. Use DIM image(161).

(16 x 20 / 2 + 2 - 1)
Reply
#5
+2-1? Why not +1?

...heh ^_^"
am an asshole. Get used to it.
Reply
#6
yeah, i'd say it's the dimming. instead, use dynamic arrays and redim them to the size you need.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#7
Hell yeah I fixed the multikey and the putting and it works excellingly perfect.

IMPORTANT: I need some sort of equation that uses TIMER that will give me 0 and 1 every other 1/4th of a second.

So that within 1 whole second it will do this:

0, 1, 0, 1

I tried TIMER MOD 2 but that just gives me 0 and 1 every whole second.
earn.
Reply
#8
This is not a real "formula" or equation, but you can play with it and make it usable (I've not been able to set up a formula, that's the truth). Anyhow, this works:

Code:
t! = TIMER
flag% = 0

DO

   IF TIMER - t! >= .25 THEN flag% = NOT flag%: t! = TIMER
   LOCATE 12, 40: PRINT ABS(flag%)

LOOP WHILE INKEY$ = ""

Just use ABS(flag%). It will be change from 0 to 1 each quarter of a second. Cheers Smile
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#9
16 * 20 / 2 + 2

just gives the necessary minimum number of array elements. In a zero-based array, a maximum array index of 1 less than that will give an array with that many elements.


Quote:+2-1? Why not +1?

...heh ^_^"
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)