Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function basNewArray(FilIn As String) As Variant
Dim FilId As Integer
Dim Idx As Integer
Dim Jdx As Integer
Dim Kdx As Integer
Dim RawFile As String
Dim MyLines As Variant
Dim MyWords As Variant
Dim TempArray(100, 7) As Variant
Dim Mu() As Variant
'I 've an array mu(MAX_1,MAX_2) where MAX_1=100,MAX_2=7
'However once I've assigned calculations to it it may turn out that
'the first index is 2 and the second is 5.
'How do I redim preserve such an array?
'If I leave it it just prints out about 700 zeros, and I know that
'you can only redim preserve the second index in a 2-dim array.
'SAMPLE Usage:
'? basNewArray("C:\My Documents\Fleas.Txt")
'C:\My Documents\Fleas.Txt is listed below
'My Dog Has Fleas
'Your Dog Has Fleas
'His Dog Has Fleas
'All Dogs Have Fleas
'This Cat Has Fleas
'That Cat Has Fleas
'Those Cats Have Fleas
'Who Doesn 't Have Fleas
'I Don 't Have Fleas
FilId = FreeFile 'File Handle
Open FilIn For Binary As FilId 'Open File
RawFile = Space(LOF(FilId)) 'Assign File String proper Length
Get #FilId, 1, RawFile 'Get File into String
MyLines = Split(RawFile, vbCrLf) 'Split file into an Array of Strings
'Do your other stuff (reading?) here, or make the array global and just fill it here, or set the calling prcedure up to expect an array as the return value and just use this to get the file into "lines".
There is SOME extra stuff (esp declarations) as I just copied ~~~~ 1/3 of another routine.