timer declaration?

In this category you can exchange your programming questions and solutions.
Post Reply
gsd4me
Posts: 1
Joined: Tue Nov 08, 2005 3:00 pm

timer declaration?

Post: # 700Post gsd4me
Tue Jan 25, 2011 5:39 pm

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

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

timer declaration?

Post: # 701Post Marco
Wed Jan 26, 2011 4:30 pm

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

Post Reply