The Big Red Toolbox

S309Timer

A Timer Control

September 21, 1999

Copyright 1999 NS BASIC Corporation


NS Basic is (c) NS Basic Corporation
Windows CE is (c) Microsoft Corporation

The S309Timer.ocx version 1.4 provides a timer ActiveX control like the one provided with Visual Basic. It allows you to generate events that are sent to your program based on the schedule you specify.

Object Creation

addobject "S309.Timer.1","Timer1",0,0

Samples




Properties
Name Value Description
Count -1, 0, > 0 Set or returns the number of times a timer event will be generated. If the Count property is greater than 0, the value will be decremented at every Timer event until the value reaches 0.
Count Description
-1 Unlimited Timer events
0 No Timer Events
> 0 Timer events until the value of the Count property is 0.
Interval 0-65535 The Interval in milliseconds between Timer events. 1000=one second.
Enabled True|False Starts or stops the Timer.
Tag variant User defined.
VersionMajor integer Returns the major version of the S309Timer. (Read Only)
VersionMinor integer Returns the minor version of the S309Timer. (Read Only)
Events
Name   Description
Timer   If Enabled=True and Interval>0, then the Timer event will be fired every Interval.

Files Included

S309Timer.ocx - the ActiveX control
S309Timer.html - the documentation (this file).
S309Timer.nsb - a very simple NS Basic example using the timer ActiveX control.

Installation of Timer ActiveX control on Windows CE

Transfer the ocx file for your processor to the \Windows directory

Register the control on Windows CE by doing:

Start - Run - regsvrce.exe \Windows\S309Timer.ocx

You should get a return code of 0.

How to register objects on Palm-size devices:

- or -

Use NS Basic/CE's SHELLEXECUTE command. There's an example in the Handbook.

Using the Timer ActiveX control in NS Basic

AddObject "S309.Timer.1","Timer1",0,0
Timer1.interval = 1000 'pop every second
Timer1.enabled = True ' start the timer.

sub Timer1_Timer()
  print cstr(now)
end sub

"Timer1" can be any name
",0,0" can be anything, but must be present. I am using mfc and could not get it to work with out an x and y coord.

The latest version of the S309Timer ActiveX control can be found here.