User Tools

Site Tools


k7:k7.4:k7.4.8:start

7.4.8 Export and import of arrays

Exporting and importing the elements of an array into a binary file - whose extension you can freely choose - is considered synonymously as exporting and importing an array.

When exporting and importing arrays into a file, a consistent distinction must be made between native and derived arrays. The reason for this is that the elements of a native array are always of a native data type and can be stored, because Gambas 3 supports the 'serialization' of variables of native data types. The elements of derived arrays, however, are objects that cannot be stored - but their object properties, if they are of a native data type.

A tried and tested way to export an array to a file is to save the contents of an array in a csv file. The exported data can be read with all editors, because a csv file is a text file. From this csv-file it is possible to import the data back into an array. Suggestions for this export-import variant can be found in –> chapter 17.7.6 GridView - Data Export and in chapter –> 17.7.7 GridView - Data Import from a csv file.

Two projects are presented for the export and import of a native and a derived array. An internal data check and a sophisticated error management (Finally, Catch, etc.) is deliberately omitted in order to concentrate only on exporting, importing and displaying the arrays.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.
k7/k7.4/k7.4.8/start.txt · Last modified: by 127.0.0.1