I could not get masmbasic.inc.
If masmbasic downloaded as a zip I would try it out.
But I don't install with .exe installers.
I like to see what is going on.
Silly I know!
So, with mshtmlc.bi, and a tweaked TALLY:
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,PartString As String) As Long
Dim As zstring Ptr z=Strptr(Somestring)
Dim As Long i=Len(PartString),count
If Left(SomeString,i)=PartString Then count+=1 'in case it starts with PartString
If Instr(SomeString,PartString) =0 Then Return 0 'no sense going on if this
While z
count+=1
z=strstr(z[i],Partstring)
Wend
Return count-1
End Function
Dim As String s=Chr(10)
Dim As String text=loadfile("mshtmlc.bi")
Dim As Double t=Timer
Print tally(text,s)
Print "Time taken ";Timer-t
sleep