>Not familiar with the CreateObject stuff. Is that heavy stuff Gerry?
The CREATEOBJECT and NEWOBJECT functions (and .AddObject and .NewOject methods)allow one to create (instantiate) objects in "code" vs dropping controls on forms.
For some classes (eg. Session), you can only create them in code so it is worth gaining some knowledge in that area.
If you need an object that doesn't need to be "extended" (ie. no extra method code), you simply create the object from its "base class"; eg. CREATEOBJECT( "Timer" ) and then explicitly set its properties via assignments.
If you need to extend the class, which is generally the case, you create a subclass of the base class and instantiate that. The subclass can be created "visually" as part of a VCX, or "in code" via DEFINE CLASS:
t1 = CREATEOBJECT( "My_Timer" )
= MESSAGEBOX( "Press ESC to CLEAR EVENTS" )
ON KEY LABEL ESC CLEAR EVENTS
READ EVENTS
ON KEY LABEL ESC
DEFINE CLASS My_Timer AS Timer
Interval = 5000
PROCEDURE Timer
THIS.Enabled = .F.
= MESSAGEBOX( "Time has elapsed" )
THIS.Reset()
THIS.Enabled = .T.
ENDDEFINE