Hey guys, don't know how active the DarkBasic community is these days but I find that DB is literally the best language ever to make a text based game which AppGameKit doesn't provide or at least is VERY limited due to not having console input etc...
on the question:
I've found myself in need of saving an array of types which i've named objects.
the follow is the type code:
type object
_name$ as string
_desc$ as string
_rarity as integer
_dmg as integer
_def as integer
endtype
next up is the AddObject function which simply adds a text item into an array:
function AddObject(item as object, size)
dim objects(size) as object
objects(size)._name$ = item._name$
objects(size)._desc$ = item._desc$
objects(size)._rarity = item._rarity
objects(size)._dmg = item._dmg
objects(size)._def = item._def
save array "objects.arr", objects(size)
empty array objects()
endfunction size
and lastly, is the PrintObjects function which will simply display the name of each item within an array.
function PrintObjects(size)
dim objects(size) as object
load array "objects.arr", objects()
for i = 0 to size
print "Name: "; objects(i)._name$
next i
endfunction
when I run the code, my error is:
Quote: " Runtime Error 54 - Array type is invalid at line 234 "
I know that doesn't mean or help much but maybe i'm wrong. Cheers!

Real programmers don't comment their code, because if it was hard to write it must be hard to read!
- PixHil Entertainment
Download Pixel Smasher on the App Store today!