Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign method works sporadically with objects
Message
From
16/08/2002 14:30:02
 
 
To
16/08/2002 14:14:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00690435
Message ID:
00690474
Views:
18
>
>(1) Any means of getting rid of the timer ?

Well, getting rid of the timer _would_ get rid of the problem, but it would also make the rest of the code useless, so no. :)

>(2) maybe
>
>>
> WITH THIS.TimerObj
>    *-- Send the header of this column to the timer
>    .Enabled = .F.
>    loHeader =  THIS.Parent.Header1
>    .HeaderObj = loHeader
>    .Enabled= .T.
>
>
>
>(3) Do not know if the following will apply to your situation
>
>I have found out that the timer event may kick in during refreshes of objects (and maybe other events/methods too, I do not know)
>When this happens, the THIS in the timer may refer to another object which method/event was interrupted. This may lead to errors and unforeseen situations
>
>I do not know whether this applies to you
>
>The way I got around this ..
>
>Timer.Event()
>
>local obj
>obj = this
>if( obj.BaseClass == 'Timer' )
>   && process the event
>
>else
>  && wait for next event
>  && uncomment following line to see whether this applies to you
>  && assert .F. message 'this is not a timer'
>endif
>
>
>I can only guess. Maybe if the timer fires, the THIS of the assign method is wrong
>
>You may add the above code to the assign method as well


I guess I shouldn't have cleaned the code up so much... Here's the whole thing:
  WITH THIS.TimerObj
    IF NOT .Enabled
      
      *-- Send the header of this column to the timer
      loHeader =  THIS.Parent.Header1
      .HeaderObj = loHeader
      
      *-- Enable it
      .Enabled = .T.
    ENDIF
As you can see, the timer is not enabled when this assign method fires, so that shouldn't have anything to do with it.

I'm wondering if it has something to do with the fact that the variable holding the timer object reference is a property? Could that be confusing it somehow?

Thanks,

Michelle
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform