Page 1 of 1

timer declaration?

Posted: Tue Jan 25, 2011 5:39 pm
by gsd4me
Can anyone explain why the compiler is giving me grief here?
It says that :
gTimer.Enabled not declared/unknown
on the line in the sub (which is an event handler) where the .enabled is set to false

many thanks


dim gTimer as timer
dim buttonPressed as integer

sub handleOneSecondTick
  ` Handles the timer click every second.

  gTimeLeft = gTimeLeft  -  1
  ` If the timer has expired - disable all buttons, stop the timer
  if (gTimeLeft = 0) then
    gTimer.Enabled = false
  end if
end sub

timer declaration?

Posted: Wed Jan 26, 2011 4:30 pm
by Marco
hi you cannot declare it as timer,
timer is reserved for the basic function.

do:

dim gtimer as wintimer

or something like this

dim gtimer as timer
gtimer.interval=1000 ``1 second
dtimer.ontimer=gsub

sub gsub
gets here every second

end sub


best regards