Code: Select all
Let>InsertCount=1
Let>ErrorCount=0
Let>UpdateCount=0
OnEvent>Custom,DialogTimeOut,UnusedVar,UnUsedSub
Timer>StartTime
Dialog>Dialog1
object Dialog1: TForm
Left = 247
Top = 97
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'POS Attendance HQ'
ClientHeight = 114
ClientWidth = 301
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 32
Top = 8
Width = 3
Height = 13
Alignment = taCenter
end
object Label2: TLabel
Left = 32
Top = 32
Width = 3
Height = 13
Alignment = taCenter
end
object Label3: TLabel
Left = 32
Top = 56
Width = 3
Height = 13
end
object MSButton1: tMSButton
Left = 112
Top = 80
Width = 75
Height = 25
Caption = 'Show Log'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
//Display Log message by setting Label1 caption
SetDialogProperty>Dialog1,Label1,Caption,Total of %InsertCount% record(s) inserted!
SetDialogProperty>Dialog1,Label2,Caption,Total of %UpdateCount% record(s) updated!
SetDialogProperty>Dialog1,Label3,Caption,Total of %ErrorCount% record(s) with error!
IF>%ErrorCount%>0
//Display Log message by setting Label1 caption
SetDialogProperty>Dialog1,Label1,Caption,An error has occurred. Please check Log for info
SetDialogProperty>Dialog1,Label2,Caption,
SetDialogProperty>Dialog1,Label3,Caption,
ENDIF
AddDialogHandler>Dialog1,MSButton1,OnClick,ShowLog
Show>Dialog1,
SRT>DialogTimeOut
Timer>TestTime
Let>Time=%TestTime%-%StartTime%
If>{%Time%>5000}
IfWindowOpen>POS Attendance HQ
CloseDialog>Dialog1
EndIf
EndIf
END>DialogTimeOut
Timer>StartTime
EndIf