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.

Newcomers DBPro Corner / problems with arrays

Author
Message
Cretinous
19
Years of Service
User Offline
Joined: 10th Mar 2005
Location:
Posted: 19th Mar 2005 22:10
I made a saving thing for my game but it keeps saying "runtime error 118..."
could anyone tell me what is wrong with my code


-------------------------------------------
----- HTTP://WWW.CRETINOUS.TK -----
-------------------------------------------
Mr Pointless
19
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 20th Mar 2005 05:13 Edited at: 20th Mar 2005 05:14


Here you go. Just needed to dim the array before you loaded it. Don't forget to undim when finished.

Iwata: "YOU'RE NOT HIM! YOU'RE NOT SUMIYOSHI! EEEEYAAAAAA!"
Sumiyoshi: "Who am I then?
Monsieur Mort
19
Years of Service
User Offline
Joined: 12th Feb 2005
Location:
Posted: 20th Mar 2005 06:44
Well now hang about... undim? why?

Why do you sink I ave zees outRAGEOUS accente?!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Mar 2005 09:04
Using undim deletes the dimension array, thus freeing memory.


"Lets migrate like bricks" - Me
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 20th Mar 2005 18:50
but if you use the array all the way through your program then DBPro will delete everything for you, so unless you need lots and lots of speed you do not have to undim or to delete objects. However, it is good prctice to do this as when moving on to bigger and better languages, because variables will remain in the memory until you tell your program to delete them or until the computer is turned off.

Part of solving the problem is actually noticing that the problem is there in the first place

Cretinous
19
Years of Service
User Offline
Joined: 10th Mar 2005
Location:
Posted: 27th Apr 2005 05:03
Thanks for the help. Does anyone have a realistic jumping code?

-------------------------------------------
----- HTTP://WWW.CRETINOUS.TK -----
-------------------------------------------
Cretinous
19
Years of Service
User Offline
Joined: 10th Mar 2005
Location:
Posted: 19th May 2005 01:40
If you have a defined type like...

And you apply it to an array like...

then does that infomation get saved when you save the array?

Mr Pointless
19
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 23rd May 2005 05:27
Maybe. Your best bet is to just try in this case.

Also, I don't think you need the symbols in an array ($,# etc). Could be wrong.

Iwata: "YOU'RE NOT HIM! YOU'RE NOT SUMIYOSHI! EEEEYAAAAAA!"
Sumiyoshi: "Who am I then?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2005 22:15
No, the compiler won't let you save an array based on a UDT. You'd need to write the load/save functions yourself.

Quote: "Could be wrong."

Nope, you're perfectly right. If you use the 'as xxxx' way of defining a variable, then you don't need the extra symbols such as # or $.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-09-23 21:21:43
Your offset time is: 2024-09-23 21:21:43