Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display real time on a form's header
Message
 
To
21/03/2002 23:58:57
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00635870
Message ID:
00635890
Views:
18
Ravi,

Run this program to put a clock on the _screen caption along wiht your application's name.
_screen.addobject("MyTimer","MyTimer")
IF VARTYPE(pcCaption) = "C"
   _screen.MyTimer.ScreenCaption = pcCaption
ENDIF
_screen.MyTimer.Enabled = .T.

DEFINE CLASS MyTimer AS Timer
Interval = 1000
screencaption = ""

PROCEDURE Init
LOCAL lcTime, ltTime
ltTime = DATETIME()
lcTime = CDOW(ltTime) + " " + CMONTH(ltTime) + " " + ;
         ALLTRIM(TRANSFORM(DAY(ltTime))) + ", " + ;
         TRANSFORM(YEAR(ltTime)) + " " + ;
         TIME()
IF EMPTY(This.ScreenCaption)
   _screen.Caption = lcTime
ELSE
   _screen.caption = This.screencaption + " - " + lcTime
ENDIF

ENDPROC

PROCEDURE Timer
LOCAL lcTime, ltTime
ltTime = DATETIME()
lcTime = CDOW(ltTime) + " " + CMONTH(ltTime) + " " + ;
         ALLTRIM(TRANSFORM(DAY(ltTime))) + ", " + ;
         TRANSFORM(YEAR(ltTime)) + " " + ;
         TIME()
IF EMPTY(This.ScreenCaption)
   _screen.Caption = lcTime
ELSE
   _screen.caption = This.screencaption + " - " + lcTime
ENDIF
ENDPROC

ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform