Code: Select all
F4::
vMyVar := A_TickCount
KeyWait, F4, D;
/* do stuff and calculations with vMyVar */
MsgBox Value of %vMyVar%
Code: Select all
F4::
vMyVar := A_TickCount
KeyWait, F4, D;
/* do stuff and calculations with vMyVar */
MsgBox Value of %vMyVar%
Code: Select all
#SingleInstance, Force
vMyVar := 0 ; Initialize variable, starting with value of 0
F4:: ; F4 Hotkey
; If "vMyVar" is 0, get A_TickCount.
; If not 0, it must already have A_TickCount from previous execution. Show existing value instead of getting new value.
vMyVar := (vMyVar ? vMyVar : A_TickCount)
; Display value in MessageBox
MsgBox, % vMyVar
return
Users browsing this forum: No registered users and 291 guests