Timer1 problem.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • The Roys

    Timer1 problem.

    Hi

    I have a problem getting code to perform under the timer.

    My program reads data from a sequential file and performs analysis on this
    data. Depending on the criteria selected this program could take up to 4
    hours to process. I want to set up a timer which displays the the progress
    of the program at 1 second intervals. (I can write this code).

    I can get the timer to work, but not while the program is running the code.
    It seems as if the processing of the data is taking up all of the resources
    and not allowing the code in the timer function to be displayed.

    Is there a way to halt the other processing for say 100th of a second while
    the code in the timer function can be displayed.

    Thanks
    Trevor.


  • Henk ten Bos

    #2
    Re: Timer1 problem.

    Maybe addding the statement

    DoEvents

    in the procedure that processes the file would do the trick

    "The Roys" <trevr62@hotmai l.com> wrote in message
    news:dMpjb.1526 94$bo1.82312@ne ws-server.bigpond. net.au...[color=blue]
    > Hi
    >
    > I have a problem getting code to perform under the timer.
    >
    > My program reads data from a sequential file and performs analysis on this
    > data. Depending on the criteria selected this program could take up to 4
    > hours to process. I want to set up a timer which displays the the progress
    > of the program at 1 second intervals. (I can write this code).
    >
    > I can get the timer to work, but not while the program is running the[/color]
    code.[color=blue]
    > It seems as if the processing of the data is taking up all of the[/color]
    resources[color=blue]
    > and not allowing the code in the timer function to be displayed.
    >
    > Is there a way to halt the other processing for say 100th of a second[/color]
    while[color=blue]
    > the code in the timer function can be displayed.
    >
    > Thanks
    > Trevor.
    >
    >[/color]


    Comment

    • J French

      #3
      Re: Timer1 problem.

      On Thu, 16 Oct 2003 05:11:37 GMT, "The Roys" <trevr62@hotmai l.com>
      wrote:
      [color=blue]
      >Hi
      >
      >I have a problem getting code to perform under the timer.
      >
      >My program reads data from a sequential file and performs analysis on this
      >data. Depending on the criteria selected this program could take up to 4
      >hours to process. I want to set up a timer which displays the the progress
      >of the program at 1 second intervals. (I can write this code).
      >
      >I can get the timer to work, but not while the program is running the code.
      >It seems as if the processing of the data is taking up all of the resources
      >and not allowing the code in the timer function to be displayed.
      >
      >Is there a way to halt the other processing for say 100th of a second while
      >the code in the timer function can be displayed.[/color]

      You really need to put the odd DoEvents in your 'tight processing'
      loop

      The side effect is that you could get someone clicking on something
      and setting off another 'strand of execution' whikl the first one is
      running.

      Comment

      • Aristotelis E. Charalampakis

        #4
        Re: Timer1 problem.

        As mentioned, use the doevents BUT prior to the execution you should disable
        the form, controls etc and re-enable them at the end.

        Doevents will also prevent Windows from claiming that your program "... is
        not responding" and threatening to end it violently.. :-)

        A.



        "The Roys" <trevr62@hotmai l.com> wrote in message
        news:dMpjb.1526 94$bo1.82312@ne ws-server.bigpond. net.au...[color=blue]
        > Hi
        >
        > I have a problem getting code to perform under the timer.
        >
        > My program reads data from a sequential file and performs analysis on this
        > data. Depending on the criteria selected this program could take up to 4
        > hours to process. I want to set up a timer which displays the the progress
        > of the program at 1 second intervals. (I can write this code).
        >
        > I can get the timer to work, but not while the program is running the[/color]
        code.[color=blue]
        > It seems as if the processing of the data is taking up all of the[/color]
        resources[color=blue]
        > and not allowing the code in the timer function to be displayed.
        >
        > Is there a way to halt the other processing for say 100th of a second[/color]
        while[color=blue]
        > the code in the timer function can be displayed.
        >
        > Thanks
        > Trevor.
        >
        >[/color]


        Comment

        • J French

          #5
          Re: Timer1 problem.

          On Fri, 17 Oct 2003 08:57:47 +0300, "Aristoteli s E. Charalampakis"
          <aristotelis_ch aralampakis@REM OVEMEhotmail.co m> wrote:
          [color=blue]
          >As mentioned, use the doevents BUT prior to the execution you should disable
          >the form, controls etc and re-enable them at the end.
          >
          >Doevents will also prevent Windows from claiming that your program "... is
          >not responding" and threatening to end it violently.. :-)[/color]

          Good advice,

          However I would stick all the controls in the Form inside a Frame

          .... And disable the Frame

          Comment

          • Aristotelis E. Charalampakis

            #6
            Re: Timer1 problem.

            of course, but remember the toolbar as well!

            Cheers

            A

            "J French" <erewhon@nowher e.com> wrote in message
            news:3f8fbb13.1 [email protected] click.com...[color=blue]
            > On Fri, 17 Oct 2003 08:57:47 +0300, "Aristoteli s E. Charalampakis"
            > <aristotelis_ch aralampakis@REM OVEMEhotmail.co m> wrote:
            >[color=green]
            > >As mentioned, use the doevents BUT prior to the execution you should[/color][/color]
            disable[color=blue][color=green]
            > >the form, controls etc and re-enable them at the end.
            > >
            > >Doevents will also prevent Windows from claiming that your program "...[/color][/color]
            is[color=blue][color=green]
            > >not responding" and threatening to end it violently.. :-)[/color]
            >
            > Good advice,
            >
            > However I would stick all the controls in the Form inside a Frame
            >
            > ... And disable the Frame[/color]


            Comment

            Working...