PDA

View Full Version : Using an Array list


RBCC
02-13-04, 04:34 PM
I Have a form with two textboxes ,listbox and a menu, the menu has a update menu which has add, delete, modify.
The listbox displays the names of people and the textboxes displays their names and addresses. If the user changes the name or address in the textboxes and clickes on modify then the file is updated with changes the user has typed. This is done with the new record in place.
the structure is as follows:

structure people
dim names as string
dim address as string
end structure
the structure variable is :
dim peoplevar as people
dim peoplearray as arraylist

this has been arraylist has been packed with data from a file called "people.txt"

now I am trying to figure out how to do this with the arraylist and then save to the existing file by overwriting it. how is this done? Is there a website that shows this? Can the arraylist.sort() method be used to sort the arraylist,how?

John

hyjacked
02-13-04, 09:51 PM
man, weird post. I finished a university assignment doing nearly the same thing a few weeks ago. I didn't use arraylist though, just 2 arrays.

anyways, general info about arraylist:
http://abstractvb.com/code.asp?A=1030

As far as writing to a file and overwriting it, just open the file for writing and it should overwrite it. If it does not do a file seek to get to the start of the file.

RBCC
02-19-04, 01:17 AM
Hyjackman,

how do I use what the user typed in the text boxes to up date the arraylist?