Original Post
Need help with the proper math for a random access file on the harddrive. I need to create a list of words that are 18 charactors long ( Single Words ) Instead of doing a sequential read/write file. I want to use random access so that when I add a word I can alphabetize it when adding to it. What would be the proper seekfile read write method.
SeekFile(filenum,((Fileposition * 18)-18))
Word$ = Readstring(filenum)
if (Myword < Word$ ) Then
SeekFile(Filenum,((FilePosition * 18) - 18))
writestring(filenum,MyWord)
MyWord = WordString
End If
FilePosition ++
Loop
Not using actual code just psuedo coding above
SeekFile(filenum,((Fileposition * 18)-18))
Word$ = Readstring(filenum)
if (Myword < Word$ ) Then
SeekFile(Filenum,((FilePosition * 18) - 18))
writestring(filenum,MyWord)
MyWord = WordString
End If
FilePosition ++
Loop
Not using actual code just psuedo coding above