|
-
Dec 7th, 2000, 11:07 PM
#1
Thread Starter
New Member
I have a large four-dimensional array in my game and I need the most efficient way of saving/loading it possible. I am currently using four For..Next loops but I'm sure there's a faster way. Anyone?
-
Dec 8th, 2000, 01:01 AM
#2
PowerPoster
Sure 
Code:
Dim Array() as Whatever
Dim Size as Long
Dim FileNum as Integer
Sub Form_Load()
size = 100000
Redim array(size)
End Sub
Save(FileName as string)
Filenum=freefile
Open filename for binary as filenum
put filenum,,size
put filenum,,array
close filenum
end sub
Save(FileName as string)
Filenum=freefile
Open filename for binary as filenum
get filenum,,size
redim array(size)
get filenum,,array
close filenum
end sub
have fun
-
Dec 8th, 2000, 01:02 AM
#3
Frenzied Member
Saving it to a file? Well just do this:
Code:
Open strFileName For Binary As #1
Put #1, , ReallyBigArray
Close #1
You don't have to use loops, just stick the whole thing in like that.
Harry.
"From one thing, know ten thousand things."
-
Dec 8th, 2000, 01:10 AM
#4
-
Dec 8th, 2000, 01:42 AM
#5
Frenzied Member
*D'oh*
Hehe
Harry.
"From one thing, know ten thousand things."
-
Dec 9th, 2000, 10:14 PM
#6
Member
Just wondering ...
What exactly are you using this four-dimensional array for?
-
Dec 10th, 2000, 02:52 AM
#7
Fanatic Member
Originally posted by Fox
Sure 
Code:
Dim Array() as Whatever
Dim Size as Long
Dim FileNum as Integer
Sub Form_Load()
size = 100000
Redim array(size)
End Sub
Save(FileName as string)
Filenum=freefile
Open filename for binary as filenum
put filenum,,size
put filenum,,array
close filenum
end sub
Save(FileName as string)
Filenum=freefile
Open filename for binary as filenum
get filenum,,size
redim array(size)
get filenum,,array
close filenum
end sub
have fun
You have 2 Save functions in your code. The 2nd one should be Open.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|