SaveDatabase

Databases
Aptilis 1

SaveDatabase(FileName, DatabaseArray[][, login, password])

SaveDatabase is the reverse of loadDatabase which loads a text database file into an array.
Each record is an element in the array, however the fields are not directly readable because they are stored in a format that speeds up their extraction.
If you have added some new records to a database (with makeRecord) or created a database from scratch, and want to save it to the usual text format, then you should use saveDatabase.

SaveDatabase can save a database to another PC by using the FTP protocol. This is when you need to specify a login and password. saveDatabase("ftp://ftp.server.com/somedir/anotherdir/aDatabase.txt", db[], "login", "password")
Protocols supported: ftp and file.

Return value:
the total number of bytes written, or -1 if there has been an error in which case _errno might contain details of the problem.

See makeRecord for a programing example.