Date: Fri, 4 Feb 2005 22:10:58 -0600 (CST) From: Mark Jacobson To: Hoss.Cartwright@uni.edu Subject: Re: hw question Hoss, > I want to initialize the numRecords and overFlow fields of all the > buckets, if that is a good idea. And you want to initialize the 3rd field too. And you want to do that for the FILE, not for an array of 11 locations. You will have a random access FILE with eleven buckets, which is just like an array, except it continues to exist on secondary storage AFTER your program stops running. It is a good and necessary idea you have, but you need to apply it to creating the FILE and forget about the array of size 11. You DO NOT want to or need to have the array of 11 buckets. You will write the record structure to the RANDOM access file 11 times. You also need to declare an instance of the structure, such as myBucket or theBucket with a Dim statement, that is probably why you get the nothing error... > Structure theBucketStructure > Public numRecords As Integer > Public overFlow As Boolean > Public students As String > End Structure Dim theBucket As theBucketStructure theBucket.numRecords = 0 <------- Do these BEFORE theBucket.overFlow = False the for loop theBucket.students = "" Good luck, Mark > For i As Integer = 1 To allRecords > arrayBucket(i).numRecords = 0 > arrayBucket(i).overFlow = False You do NOT need this array, you are going to write the i-th bucket inside this loop with the three variables set to 0, False and the null string "" for students field. filePut operation would go here..... > Next > > The error says: > > arrayBucket = Nothing > > How would I initialize the arrayBucket that is declared as follows: > > Dim arrayBucket() As theBucket > > where > Structure theBucket > Public numRecords As Integer > Public overFlow As Boolean > Public students As String > End Structure > > I want to initialize the numRecords and overFlow fields of all the > buckets, if that is a good idea.