Restored from previous forum. Originally posted by Franco.
Code: Select all
; (c) 2001 - Franco's template - absolutely freeware
; SetLine(Line) works with text files
; Returns the pointer position for this line
; If you set a line number higher than there is available you get 0
; Example: Line30StartsAt = Setline(30)
; Returns the pointer position for line # 30 and will set this position
Procedure SetLine(File, Line)
LineNumber=1
If Line>1
While LineNumber<Line
ReadString(File)
LineNumber=LineNumber+1
NewPos=Loc(File)
If NewPos=Lof(File)
FileSeek(File, 0)
Goto ExitSetLineWhile
EndIf
Wend
ExitSetLineWhile:
Else
FileSeek(File, 0)
EndIf
ProcedureReturn Loc(File)
EndProcedure
Franco
Edited by - franco on 09 October 2001 18:50:05