I have a list of people in a text file that I want to read into an array and
then manipulate the data.  The list of names changes so I don't know how big
to make the array.  I loop as I read a line from the text file:

Dim Array(1)
Open "c:\namelist.txt" For Input As #1

i = 0
Do Until EOF(1)  ' Count lines of Text
  Line Input #1, LineOfText
  Array(i) = LineOftext
  i = i + 1 
  ReDim Preserve Array(i)
Loop

Close #1

'Preserve saves the previously entered array data

-----Original Message-----
From: HouseDad [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 27, 2005 8:34 AM
To: [email protected]
Subject: [vbhelp] Arrays



I am finally getting around to using some code you guys gave me a 
while back to handle multiple file selection.  The way it works is it 
loads an array that is declared like "array()".  My question is, is 
there a property or way to tell how many values are in the array or 
do I have to trap an error?

What will happen, hopefully, all the selected filenames will be 
loaded and then I will have to use some kind of loop to read the 
values incrementally until the last one has been read.

Chris







'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links



 











'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to