is it better to use "dim as string array(any) " or "Redim as string array(1 to 1)" ??
what example is correct? or are both ok to use?
example 1:
Code: Select all
sub check_files
dim as string file_array(any) '<----- USING 'ANY'
dim as ulong file_entries
'open file 1 and get file entries from 1st line
redim file_array ( 1 to file_entries )
for i as ulong = 1 to file_entries
'load file into file_array
next i
'do some stuff with file 1
'open file 2 and get file entries from 1st line
redim file_array ( 1 to file_entries )
for i as ulong = 1 to file_entries
'load file into file_array
next i
'do some stuff with file 2
end sub
Code: Select all
sub check_files
redim as string file_array(1 to 1) '<----- USING 'REDIM'
dim as ulong file_entries
'open file 1 and get file entries from 1st line
redim file_array ( 1 to file_entries )
for i as ulong = 1 to file_entries
'load file into file_array
next i
'do some stuff with file 1
'open file 2 and get file entries from 1st line
redim file_array ( 1 to file_entries )
for i as ulong = 1 to file_entries
'load file into file_array
next i
'do some stuff with file 2
end sub
Thanks every one!! :D
-SamL