Posted by Grant Foraker on July 21, 2015 at 13:46:04:
In Reply to: WAKEUP difference posted by Grant Foraker on July 08, 2015 at 13:09:13:
With Comet Woman's help, TIMER.IBS, and a few holes in the office wall, I have SetTimer working the way I want. A bit convoluted so I'm going to post the interesting bits.
First, WAKEUP is like a Bank's vault. It won't open until the designated time. So, stay clear of Greek banks at closing time. There may not be an opening.
SetTimer is more like the timer on a Microwave. You can go off and watch TV until the timer goes beep, beep, beep.
A. the bit at the top of EventHandler catches the timer when it goes off. I don't want to reset the timer right now so I turn it off. I use SatisfyInput to set a null to the Input that's waiting in WaitForJTFTransactions.
B. the bit in ID.CANCEL, sets my CANCEL$ flag, turns off the timer and does the SatisfyInput.
C. Down in WaitForJTFTransactions, the INPUT drops thru and I either encounter the CANCEL$ flag and RETURN or drop into the JTF update routine. A new timer is set based on Day of week and time of day.
!================================================================================================
EventHandler:
gosub CW.ParseEvent ! which type of event
!------------------- COMET 32 --------------------------------------------------
if sub(CW.Event$,1,6) = ":TIMER"
msgbox("Wakeup timer expired")
SetTimer "", 0 ! STOP THE TIMER
PRINT (0) (SatisfyInput= '')
eventsub EventHandler CW.Event$ CW.Source$
RETURN
endif
!-------------------------------------------------------------------------------
select case cosCtlId
case IDC.PROCEED
LET cosCtlID = IDC.PROCEED
LET cosState = cosEW.Disable
GOSUB COS.EnableDlgItem
GOSUB InitListBox
Let cosCTlId = IDC.MESSAGE
Let cosCtlText$ = 'Job Cost Update in progress.'
LET coswParam = ListIndex
Gosub COS.ListAddStringData
LET ListIndex = ListIndex + 1
Eventsub EventHandler CW.Event$ CW.Source$
GOSUB WaitForJTFTransactions
!==================================================================================
case ID.CANCEL
LET CANCEL$ = 'Y'
!------------------- COMET 32 --------------------------------------------------
MSGBOX 'CANCEL BUTTON'
SetTimer "", 0 ! STOP THE TIMER
PRINT (0) (SatisfyInput= '')
!-------------------------------------------------------------------------------
gosub CW.CloseAutoModeDialog ! Start dialog closing if desired
!====================================================================================
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!------------------- COMET 32 --------------------------------------------------
!!!!! WAKEUP WAKETIME$
LET DURATION = 60 * 1000 ! 60 seconds
SetTimer 'Wakeup' 60000
Eventsub EventHandler CW.Event$ CW.Source$
INPUT (0) ''
MSGBOX 'TIMER DONE'
!-------------------------------------------------------------------------------
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.