SORTING For Beginners (Getting DATA from a File)
Posted: Sat Jul 09, 2005 4:43 pm
Getting data from a sample data file to load and sort a multi-dimensioned array. Sort the array using a selected data field. Write the sorted array to an output file.
The array "myContacts$(x,y)" gets 13 records, of 4 fields each, from "myTestData.txt". Sorting can be selected from surname, christian name, age, or telephone number. The sorted array is output to "myContacts.txt".
Source code is included as dataSort.bas, and myTestData.txt for practice. When printing myContacts.txt, myTestData.txt remains unchanged so you can continue practice while making modifications to the source code.
The array "myContacts$(x,y)" gets 13 records, of 4 fields each, from "myTestData.txt". Sorting can be selected from surname, christian name, age, or telephone number. The sorted array is output to "myContacts.txt".
Source code is included as dataSort.bas, and myTestData.txt for practice. When printing myContacts.txt, myTestData.txt remains unchanged so you can continue practice while making modifications to the source code.