I am using the following code kindly donated by Alex von Siebenthal to read from a text log file. This will grow in size throughout the day.
I know that vb uses the ‘Seek Function’ to get and mark the current read/write position. Does Xojo have a similar function.?
[code] Dim f As FolderItem
dim fiveMinutesAgo as new Date
fiveMinutesAgo.TotalSeconds = fiveMinutesAgo.TotalSeconds - 5 * 60
dim logFile as folderitem = GetFolderItem(“c:\ex130725.log”)
dim count as Integer
if logFile<> nil and logFile.Exists then
dim t as TextInputStream = TextInputStream.Open(logfile)
t.Encoding = Encodings.UTF8
While Not t.EOF dim line as string = t.ReadLine if instr(line, "BJLive/Default.aspx?") > 0 then dim logDate as new date logDate.SQLDateTime = trim(line).Left(19) if logDate >= fiveMinutesAgo then count = count + 1 end if end if wend t.close
Label1.text = str(count)[/code]
Thanks for your help and advice.