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 / This error message makes no sense!!!! Aaaaaaaaaaaargh!

Author
Message
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 12th Sep 2003 17:51
I am trying to load an array from a file. Here is the VERY SIMPLE function in my code:



The stupid program will not compile unless I REM this function out. I get the following error message:

#100008: Parameter for 'LOAD ARRAY' do not match 'Filename, Array Name(0)' at line 1342

What is going on. As far as I can see there is nothing wrong with this line of code. I have tried altering the values in the array, everything.

I am really at my wits end (I have been screaming at my PC for 3 hours!!!!!!)

Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 12th Sep 2003 18:20
load array LoadMap$,MainSave$(0)

is probably what you want, all the error is trying to say is that it can`t work out what the command is trying to do, the help says..

SAVE ARRAY
This command will save the contents of the array to the specified file. It is highly recommended that the
array used to save the data should be identical to the one used when reloading. When specifying the array
name, the array index numbers are ignored, but you must still provide them to ensure the array is
recognized.


SYNTAX
SAVE ARRAY Filename, Array Name(0)

which is misleading, since you just use zero normaly, for that multidimensional array I`m not sure if you need

arrayname(0,0,0)

or just

arrayname(0)

I suspect the later, I don`t use arrays to save data, I am too used to writing normal files and they are no slower and more flexible, cheers.

Mentor.
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 12th Sep 2003 18:47
FieldDoc:

Two things come to mind, although it's more likely to be the latter

A) The compiler may be getting confused with the clash of Variable and Function names .. ie the function is called LoadMap and theres avariable LoadMap..

B) Load/Save array don't actually treat the array you provide as a starting index, but as a pointer to the array structure it'self. So if you want use the load array commands to merge data, Dbpro's load array command can't do it.

or maybe a combo of both.

Anyway, Something like this should work

Quote: "
Dim MainSave$(100,200,400)

FUNCTION LoadMap(File$ AS STRING)
`LoadMap$ is the full name of the file (including extension)
LOAD ARRAY File$, MainSave$(0)
EndFUNCTION

"


Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 12th Sep 2003 20:06
Thankyou UWDesign! I wasn't dimming the arrays before I loaded them. I never realised I had to!

Am still having trouble loading stiff though.....so many variables to contend with!!

Thanks again,

Login to post a reply

Server time is: 2026-07-24 23:23:32
Your offset time is: 2026-07-24 23:23:32