This is part of the HicEst documentation
CountDown: Shows Window, Write, Subroutine, Messagebox
A dialog sets and starts a countdown. Title and taskbar show min:sec. When time is over or a key is pressed, a modal message overlaps all other windows.
⇾Home
⇾Contents
⇾more General
⇾ Examples
The example script "Countdown.hic" is also contained in the
Download
file. It demonstrates how:
Set and start a countdown in a dialog
The window titlebar shows "min : sec", same is the icon on the taskbar.
The window is minimized.
A message box opens when time is over or if a key is pressed.
4
WINDOW
(MAXImize=0)
!
how to define a label
,
how to maximize or minimize a window
WRITE
(FONt='Segoe', F='UWWW HH:mm', DeCoR='BC=0 RA=15', A='C', BC=0, FC=4, PoinT=100) 0
!
how to multi use the script window
WRITE
(M='M?yB', OnButton="SetCountdown",
Format
='"It is ", UWWWWWWWW DD.MM.CCYY @ HH:mm|, A', IOStat=rc) 0, "Start a" && Minutes & " minutes," && Seconds && "seconds countdown ?"
!
how to handle a messagebox
WINDOW
(MINImize=0)
! minimizes the script window
DO
secondsToGo = 60*Minutes+Seconds, 1, -1
!
how to program a loop
IF
(
KEY
() == 0 )
THEN
!
how to check for keyboard activity
WRITE
(TitleBar,
Format
='Umm:SS, A') secondsToGo / 60 / 60 / 24, ' to go'
!
how to write text to titlebar and taskbar
SYSTEM
(WAIT=1000)
!
how to make the script wait a while
ELSE
!
how to if then else endif
WRITE
(M="?1yB", OnButton=4) "Countdown pause ... | Continue ? | (still" && secondsToGo && "seconds to go)"
!
how to make execution jumps
ENDIF
ENDDO
GOTO
4
!
how to make execution jumps
END
! this terminates the "MAIN program of" of "countdown.hic" (not required)
SUBROUTINE
SetCountdown
!
how to define a subroutine
DLG
(Button="Start", B="Continue", NameEdit=Minutes, Line, DNum, MIn=0, NE=Seconds,L,DN, MIn=0, MAx=59, TItle="Set countdown time")
END
! this terminates the subroutine (required)
⇾
Support HicEst
⇾
Impressum
©2000-2019 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.