ok i almost have this working however i'd like to make it more efficient. right now i read in a file with the input function and use the loc and LOF functions to determine the length and position of the record. in doing so i use a progress bar. however this is very slow and i would like to make it run faster. i know i could make the number greater in the input function but i never know how long a record is to the carriage return and line feed ASCII codes. what i would like to do is use the input statement rather then the function if possible and read each column into a variable. I know how many columns there are just not the length. here is the code so far.
VB Code:
Dim sBuffer As String Dim x As String With Me.ProgressBar1 .Min = 0 .Max = FileLen(App.Path & "\ClassPosition_SkillList.txt") End With Open App.Path & "\ClassPosition_SkillList.txt" For Binary As #1 ' Open file just created. Do While Loc(1) < LOF(1) ' Loop until end of file. DoEvents x = Input(1, #1) If x <> "" Then If Asc(x) <> 10 And Asc(x) <> 13 Then sBuffer = sBuffer & x Else sBuffer = "" End If End If Me.ProgressBar1.Value = Loc(1) Loop Close #1
any help will be greatly appreciated.




Reply With Quote