robertgenova
Programmer
Hi
for beginning thanks for your help!
I want to make a general program that use the "get random" but I found a problem
Infact it seem that "Get random" needs a string where put the record of the right lenght: this string MUST be of the right lenght of the record and the lenght of the string could be defined directly or only with a const
I tried to modify the string len, but program give me error
Because I want to use the same code for different files (with different record length) , is it possible to "jump" this problem?
Here a sample of my code
Const len_rec = 207 'len record + chr(13) and chr(10)
Dim FileRecord As String * len_rec
dim File_1 as string
.
.
.
Open File_1 For Random As 1 Len = len_rec
dim I as long
dim NumFile_INP as integer
I = 1
File_1 " "c:\file1.txt"
NumFile_INP = freefile
Do While True
FileRecord = Space(len_rec)
Get #NumFile_INP, I, FileRecord
If Not EOF(#NumFile_INP) Then
else
exit do
end if
I = I + 1
Loop
Close #NumFile_INP
Thanks again
for beginning thanks for your help!
I want to make a general program that use the "get random" but I found a problem
Infact it seem that "Get random" needs a string where put the record of the right lenght: this string MUST be of the right lenght of the record and the lenght of the string could be defined directly or only with a const
I tried to modify the string len, but program give me error
Because I want to use the same code for different files (with different record length) , is it possible to "jump" this problem?
Here a sample of my code
Const len_rec = 207 'len record + chr(13) and chr(10)
Dim FileRecord As String * len_rec
dim File_1 as string
.
.
.
Open File_1 For Random As 1 Len = len_rec
dim I as long
dim NumFile_INP as integer
I = 1
File_1 " "c:\file1.txt"
NumFile_INP = freefile
Do While True
FileRecord = Space(len_rec)
Get #NumFile_INP, I, FileRecord
If Not EOF(#NumFile_INP) Then
else
exit do
end if
I = I + 1
Loop
Close #NumFile_INP
Thanks again