Posted: Fri Aug 01, 2003 4:57 pm
thx Paul 

http://www.purebasic.com
https://www.purebasic.fr/english/
known bug (a missing CRLF at the last line) , should been for the next version.Yian_The_Craft wrote:I have a test.txt which is 4 lines:
1
2
3
4
but when I use that example code it only reads the 3 lines.If I make it 5 lines it only reads 4.
Code: Select all
Procedure.s TestRead(inFile.s)
sLine.s
iLoop.l
countLines.l
If FileSize(inFile) > -1
countLines = FastOpenTextFile(inFile)
For iLoop = 1 To countLines+1
sLine=FastReadLine(iLoop)
Next
FastCloseTextFile()
EndIf
ProcedureReturn sLine
EndProcedure
If OpenWindow(0, 0, 0, 150, 150, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Test")
;
If CreateGadgetList(WindowID())
ButtonGadget(5, 70, 135, 80, 15, "Test")
EndIf
;
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
GadgetID = EventGadgetID()
Select GadgetID
Case 5
t1=GetTickCount_()
sTest.s=configGetValueTest("c:\test.txt")
t2=GetTickCount_()
MessageRequester("Result: "+StrU(t2-t1,2),sTest)
EndSelect
EndIf
Until Event = #PB_EventCloseWindow
EndIf
End
You must be having very good weather where you liveRings wrote:a small (bugfixed) update is here FastFile V4.2
This is the last version before i update to V5 (which is nearly ready for release, only the fine weather stops my work )