local mf = getMainForm() local sd = mf.SaveDialog1 local od = mf.OpenDialog1 local sdOrigOnClose = sd.OnClose local odOrigOnClose = od.OnClose local function returnFileName(path) --extracts file name from full path (not full path => return nil) return (path~=nil) and (path:match("\\([^\\]+)$")) end local currentTableNameLabel = createLabel(mf.Panel5) currentTableNameLabel.AnchorSideLeft.Control = mf.foundcountlabel currentTableNameLabel.AnchorSideLeft.Side = asrBottom currentTableNameLabel.AnchorSideTop.Control = mf.foundcountlabel currentTableNameLabel.AnchorSideTop.Side = asrCenter currentTableNameLabel.BorderSpacing.Left = 20 currentTableNameLabel.Caption = 'Table: ' local currentTableNameTimer = createTimer(mf) currentTableNameTimer.Interval = 200 currentTableNameTimer.OnTimer = function (t) if mf.active then t.Enabled = false end local name = returnFileName(sd.Filename) if name then currentTableNameLabel.Caption = 'Table: "'..name..'"' else currentTableNameLabel.Caption = 'Table: ' end end local function OnClose(sender) if sdOrigOnClose then sdOrigOnClose(sender) end currentTableNameTimer.Enabled = true count = 0 end sd.OnClose = OnClose od.OnClose = OnClose