It's harmless, but it really clutters up the dropdown list of sessions!
Yes, empty sessions occasionally happen. Maybe I pop open the IDE, then get distracted and don't edit anything.
Over time, I can build up 50+ quick empty sessions in my History list!
In the meantime, I wrote an invisible IDE tool to delete empty sessions at startup:
Code: Select all
; Build, add to IDE Tools with "Editor Startup" trigger
;
File.s = GetPathPart(GetEnvironmentVariable("PB_TOOL_Preferences")) + "History.db"
If (FileSize(File) > 0)
UseSQLiteDatabase()
If (OpenDatabase(0, File, "", ""))
NewList SID.s()
If (DatabaseQuery(0, "SELECT session_id FROM session"))
While (NextDatabaseRow(0))
AddElement(SID())
SID() = GetDatabaseString(0, 0)
Wend
FinishDatabaseQuery(0)
ForEach SID()
If (DatabaseQuery(0, "SELECT COUNT(*) FROM event WHERE session_id='" + SID() + "'"))
If (NextDatabaseRow(0))
Count.i = GetDatabaseLong(0, 0)
If (Count = 0)
DatabaseUpdate(0, "DELETE FROM session WHERE session_id='" + SID() + "'")
EndIf
EndIf
FinishDatabaseQuery(0)
EndIf
Next
EndIf
CloseDatabase(0)
EndIf
EndIf