If line 31 is un- commented, then the result is different else the result is the same.
Code: Select all
#include "file.bi"
#include "crt.bi"
'Run with the best - 32 bit -gen gas, the FreeBASIC as free from C as pos. (except msvcrt.dll or it's Linux counterpart)
Function loadfile(file As String) As String
If Fileexists(file)=0 Then Print file;" not found":Sleep:End
Dim As Long f=Freefile
Open file For Binary Access Read As #f
Dim As String text
If Lof(1) > 0 Then
text = String(Lof(f), 0)
Get #f, , text
End If
Close #f
Return text
End Function
Function Tally(SomeString As String,Part As String) As Long
Dim As zstring Ptr z=Strptr(Somestring)
Dim As Long i=Len(Part),c
While z
z=iif(c,strstr(z[i],Part),strstr(z[0],Part))
c+=1
Wend
Return c-1
End Function
Dim As String text=loadfile("mshtmlc.bi")
'text=lcase(text)
Dim As Double t=Timer
Print tally(text,"type")-tally(text,"end type")
Print "Time taken ";Timer-t
sleep