|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Record Count of an open file(b4 looping)
I have a file I need to open (flat file) and I want an array to essentially be the sizeof the record count in this file. Is there a way to know the record count before you loop through the records in the file?
I appreciate any help. tnx |
|
#2
|
|||
|
|||
|
What is the definition of "record count" for a flat file?
|
|
#3
|
|||
|
|||
|
Doug G -
Sorry, I should’ve been more specific. I'm using the term record somewhat loosely. An example: 1rec 2rec 3rec Etc.... I have a flat file that I'm opening and need to populate an array with the data from the flat file. So my redim, of the array, would need to occur before I can start populating the array. Without sizeOf() I'm not sure how to accomplish this in VB. Unless I first, getting the count via a loop and then re-opening the file and loop through it again which isn't very elegant. |
|
#4
|
|||
|
|||
|
Maybe this will help...
Open SomeFile For Binary Access Read Lock Read As _ #FileNumber Len = Len(FileNumber) ReDim sArry(cntr) Do While Not EOF(FileNumber) Input #FileNumber, sArry(cntr) cntr = cntr + 1 Loop Close #FileNumber |
|
#5
|
|||
|
|||
|
Never mind... brain fart...
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Record Count of an open file(b4 looping) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|