Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Once again, I see nothing wrong with the code.. Please help me 8(

Author
Message
Galiem
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 27th Mar 2003 04:54
The error is:

Runtime Error 8204 - File is not open at line 11

Line 11 is "MAKE MEMBLOCK FROM FILE 1,1"

Here's the code:


OPEN TO READ 1,"Data\Info"
MAKE MEMBLOCK FROM FILE 1,1
CLOSE FILE 1

Initi = MEMBLOCK BYTE(1,1)

IF Initi = 0
DELETE FILE "Data\Info"
Comp()
ENDIF

Initcheck:

SET WINDOW LAYOUT 1,1,1
SET WINDOW TITLE "DRDBMS Main Window"

DO
GUI()
LOOP
ender:
END

FUNCTION GUI()

LOAD BITMAP "Menus\Images\main.bmp",1
Buff = 0
COPY BITMAP 1,0,0,223,24,0,0,0,223,24
back:

ctrl = CONTROLKEY()
esc = ESCAPEKEY()

IF ctlr = 1 AND esc = 1 THEN GOTO ender

mx = mousex()
my = mousey()
mc = mouseclick()

IF mx 183 OR my > 185
CLS
COPY BITMAP 1,0,0,223,24,0,0,0,223,24
GOTO back
ENDIF

IF my 183 OR my > 185
CLS
COPY BITMAP 1,0,0,223,24,0,0,0,223,24
GOTO back
ENDIF

IF my
Galiem
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 27th Mar 2003 04:55
dernit why does this code button never work the first time lol

I have a feeling the most seasoned coders look like noobs here...

One more try



Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 27th Mar 2003 13:53
No-one can run that code without the media (and I personally don't have the time to edit the code to remove references to it).

Why not try something simple - like opening the file, creating the memblock and then using the memblock exists command to check that actually worked? Or even read a line from the file to see if it worked.

Also if you open (or try to open) a file that doesn't exist you'll get the error you mention.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Galiem
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 27th Mar 2003 16:17
I'm not sure what happened, but I closed DBPro, and opened it back up, and the code worked... It must have restored the backup, though I can't figure out what change was made... TY for the suggestions though...

I'm going to attempt to refrain from asking for help in the forums anymore lol...

Mostly due to my foolish pride, but also due to the fact that since I posted this, the code has doubled in size. On two occasions now I got an error I couldn't figure out, but when I closed and reopened DBPro, it was fixed. This is not to say the changes I made got reset... I save often and frequently too (I know they mean the same thing, just saying I save alot... a whole lot...)

Who knows, maybe I'll be able to help a person or two on here in times to come. I can't stand being the newbie in any community lol.

Login to post a reply

Server time is: 2026-07-11 14:36:26
Your offset time is: 2026-07-11 14:36:26