Code: Select all
OpenConsole()
#FILENAME = "C:\TEST\TESTFILE.TXT"
If OpenFile(0, #FILENAME, #PB_Ascii)
PrintN ("Creating new file...")
WriteString(0, Space(163840) , #PB_Ascii)
TruncateFile(0)
CloseFile(0)
EndIf
PrintN ("Processing file for for reading...")
If FileSize(#FILENAME) < 0
PrintN("File error : The file does not exist")
Else
If OpenFile(0, #FILENAME, #PB_Ascii)
PrintN (Str(ElapsedMilliseconds()))
FileSeek(0, 0)
While Not(Eof(0))
inputchr.b = ReadByte(0)
output.s = Chr(inputchr.b & $FF)
buffer.s = buffer.s + output.s ; * <---- Remove line line, bottleneck is here
Wend
PrintN (Str(ElapsedMilliseconds()))
CloseFile(0)
EndIf
EndIf
Print("Press Enter : ")
Input()