Forum Discussion

paarmann-ara's avatar
paarmann-ara
Contributor
6 years ago

wItemCount and WaitProperty

I have Qustion about WaitProperty! I want know, may I use a Secound Parameter of WaitProperty like a boolian or how can I?   like: Object.WaitProperty(wItemCount, wItemCount > 0)
  • RUDOLF_BOTHMA's avatar
    RUDOLF_BOTHMA
    6 years ago

    This is a error:

    The window with the 0x00010800 handle exists but did not respond during the auto-wait timeout (150 ms)

    This error raised because ListView.wItemCount is not ready.


    This could perhaps mean that TCs pointer to the object still exists, but that the item it was pointing to was destroyed, recreated or disposed in some way.  If this is the case, the pointer ha changed and you will have to refresh your object and fetch again.  TC will never find the property even though it thinks it can see it, since that is an old handle

  • tristaanogre's avatar
    tristaanogre
    6 years ago

    What RUDOLF_BOTHMA  sounds like the best case.  This is especially the case if you have assigned an object to a variable at one point in the project and then navigated away or refreshed the screen or something. Everytime you close a window and re-open, you destroy and create object handles.  So, if you're persisting an object via variable, you need to refresh it everytime the application recreates the object.  Using WaitChild or WaitAliasChild liberally throughout your code is key to this.  I try to NEVER store on-screen objects in global variables and keep them scoped to the local function and/or procedure.  

  • RUDOLF_BOTHMA's avatar
    RUDOLF_BOTHMA
    6 years ago

    tristaanogre wrote:

    I try to NEVER store on-screen objects in global variables 


    I recall doing it in the really early days of my TC development.  In the end I always had to refresh & refetch the object everytime, so there was no gain in doing it this way - even a bit of a perfromance loss.  Wait methods in local scope or at least within the local functions where the most reliable and efficient