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 / Stumped by Read Commands

Author
Message
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 25th Sep 2003 22:00
I've set up the commands for loading and saving several User Defined Types Arrays. The Program Writes correctly, due to the fact that when one upons the file it creates, you can see the string it wrote. However, when I try to load, it does nothing. The values it used to be stay the same. I can't see what I'm doing wrong.
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 25th Sep 2003 22:01
Well... this is prolly not it, but have you made sure that those arrays are declared before loading the game?

More complete code would help...

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 25th Sep 2003 22:12
I would have put up all the code, but it's more than 1500 lines, so I didn't think it wise. If it becomes necessary, I'll put the code in a zip package so you can download it. And to answer the other question, Yes, I have defined the Arrays before loading the game, and I just realized this now, but do you know if having values already in the arrays before loading would affect it?
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 26th Sep 2003 12:33 Edited at: 26th Sep 2003 12:33
now that's a silly question from a guy who programmed more than 1500 lines of code.
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 26th Sep 2003 15:44
True, one would think somebody who programmed 1500. After counting it better, it's more like 1107. And even then, I've never used the File commands before, so I'm not entirely knowledgeable of the little quirks that I've found in most things i've done. And after realizing I'm going to go mad if I can't figuare out this problem, I've tossed all the code into the code window. The save and load commands start at line 569, and the arrays are up near 80. Tow things to note when using it. One, to save, type Save at the prompt where you say "Fight", and to load, type "Load" at the same area. 2nd thing to note is everything must be capatalized as you see it. Still havn't gotton around to changing that.
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 26th Sep 2003 15:46
Ah, quick note, you need to rem the load bitmap command at 147, or it won't run.
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 26th Sep 2003 18:02
SOB! After almost 6 hours of looking at this code, I finally found the problem.

Right:
ResponseVar$

Wrong:
ResponeVar$

I would have been able to see this right off the bat if the Stupid Step through mode was working. Has anyone else but me noticed that it crashes on the first line, no matter what's there?
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Sep 2003 19:48
a debugger shouldn't be necessary to catch variable spelling errors, the IDE should do it! But we all know TGC is not responsible for the IDE, nor will they be doing anything about it - we know we know.

Hopefully the IDE's that people are working on independently will be more like a real IDE, no offense to Guy S.

-RUST-
haggisman
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 26th Sep 2003 19:52
Quote: "nor will they be doing anything about it "


Nobody said they wouldn't do anything about it, its just the current IDE wont/cant be updated. They can still make a completely new one to replace it, who knows?

Defying the convention of an upright avatar since 1985
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 27th Sep 2003 00:46
CattleRustler: That's not entirely true. with that specific spot of code, I would have been able to tell right off the bat it was skipping the read commands, due to the fact the misspelled variable was in an if command. Although, you are also right with that comment on the IDE cathcing it. I hear some of the User-Developed IDE's are going to have something of that nature in them. We'll just have to hope it becomes a feature in the best one!
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Sep 2003 00:58
yes, Option Explicit and Option Strict would be great for starters!

-RUST-
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 27th Sep 2003 01:12 Edited at: 27th Sep 2003 01:12
Usermlsra - Download patch 5.1b as it fixes the step through bug!

Quote: "Compiler once again allows programs to compile with step-through breakpoints (stepthroughbug)"


If your mansion house needs haunting, just call Rentaghost!
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 27th Sep 2003 06:47
Ack! Hadn't realized there was a new patch! You know what, they ought to look into an auto-update program, like most of the newer games have. Certainly make it easier to stay up to date.

Login to post a reply

Server time is: 2026-07-25 07:01:12
Your offset time is: 2026-07-25 07:01:12