Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timer
Message
From
27/11/2002 06:07:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
27/11/2002 02:45:50
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Re: Timer
Miscellaneous
Thread ID:
00727425
Message ID:
00727471
Views:
9
>hi all,
>
>i like make application using timer, does anyone know..what good solution for this cases..thank's
>
>regard
>wahyu

In addition to Jess'es suggestions, a Timer can be used to postpone a certain action. For instance: when the user moves through a List or Grid, the details (perhaps in TextBoxes) should be updated). Since this updating might be slow, the action is postponed until the user stays on a certain record for, say, a second. This sounds difficult, but is fairly easy to achieve with a timer:

  • Each time the user moves to a different record, the Timer is enabled (.Enabled = .T.) and reset (.Reset()). If the user moves to another record in less than a second, the Timer is Reset again, therefore, it doesn't fire yet. If the user stops, the Timer is allowed to run.
  • When the Timer runs, it first disables itself (This.Enabled = .F.), then does the necessary refresh work, which is either programmed directly into the Timer() Event, or the Timer() Event calls a form method.

    I use a Timer mostly to postpone deletion of files: I create a temporary file which has to be opened by an external program (for instance, NotePad). Since I don't want to delete the file before NotePad has the chance to open it, I postpone the deletion for a few minutes.

    HTH, Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform