Quote: "how to setup multi recordset on a single file with deleting the file every time"
If you mean saving the contents of
more than one array into the
same file then you cannot do it with Save Array and Load Array because the filename is one of the command's parameters. (Each time you save an array with the same filename it will delete the one you last saved).
Assuming (like Latch) that you meant 'without deleting' rather than 'with', you have two options.
1. Have all your data in a single multi-dimensioned array and use Load/Save Array. The down side is that you cannot mix data types - ie the array must be integer, float or string only. However if you use string arrays they can be used to store all types - converting from one to the other when loading/saving.
Ie: Dim Database$(MaxRecords,NumFields)
If you created the array with
Dim Database$(1000,12) this would allow up to 1000 records, each with 12 fields (using fields element zero for the field name for example).
2. Use Open To Read/Write and load/save the contents of all arrays manually in For..Next loops. The advantage of this is that you can save any combination of string and numeric arrays before closing the file.
Whichever method you use, as Latch says, there's no random file access in DBC - only sequential. So, when you open a file for writing, the file
cannot already be there and if it does, you have to delete it first.
Not losing data is a simple case of checking when the program first runs to see if a data file already exists - using File Exist() - and if it does, load the contents into memory.
You add the new data to what is already in memory and just before saving it you delete the existing file(s).
A good place to start for answers to most beginners questions:
http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10
(See Tutorial 4 - File Access).
TDK_Man