Hello Vic,

I would be less inclined to think this is a SearchText bug. I would think this has more to do with you using dynamic clips. Remember, if you get a dynamic clip, it is only good while that clip is truly on the screen. So if you have a screen that is in flux you may have it and then poof, it would be gone. So doing your SearchText probably did find a match but by the time you went to use it the clip went away from the screen. Because of this I suggest you use static clips instead of dynamic. So instead of:

Set C = ActiveWindow.Clips.SearchText("Used:")

you should do:

Set C = ActiveWindow.Clips( , False).SearchText("Used:")

Notice after the Clips method I added a left paren followed by a comma followed by False and finally a right paren. The comma just skips the first option parameter (IncludeChildren) and the False indicates to NOT use RealTime clips.
Hope this helps!

Regards,
Doug



Vic Beckley wrote:

Chip,

This has worked for me in other applications so it may be something odd thas app is doing. I resorted to the On Error object to get around it. Thanks for the response, though.

Vic

*From:* Chip Orange [mailto:[email protected]]
*Sent:* Saturday, March 06, 2010 2:43 PM
*To:* [email protected]
*Subject:* RE: Clearing a collection of clips

Vic,

This sounds very much to me like a bug in clips.searchText. I don't see you're doing anything wrong, and I can't think of what you can do except to give up use of searchText (luckily you can do this manually) until it's worked out.

You shouldn't need to "reset" anything, as the variable is recreated each time. However, you might try adding a "activeWindow.redraw" at the beginning of the sub, or perhaps only after you've found them, to see if it helps:

hth,

Chip

------------------------------------------------------------------------

*From:* Vic Beckley [mailto:[email protected]]
*Sent:* Friday, March 05, 2010 8:15 PM
*To:* [email protected]
*Subject:* Clearing a collection of clips

Hi all,

I am using the following sub to find certain clips when they exist on the screen.

Sub timeInfo()

If ActiveWindow.ModuleName = "EZCDDAX" Then

Dim C, D

Set C = ActiveWindow.Clips.SearchText("Used:")

Set D = ActiveWindow.Clips.SearchText("Available:")

If C.Count > 0 And D.Count > 0 Then

Speak c(1).Line.ClipsText

Speak D(1).Line.ClipsText

Mouse.Position = D(1).Position.ScreenPoint

Else

Speak "Statistics not found"

End If

End If

End Sub

The problem is that when I am on a screen where the searched for clips do not exist and I have found them previously I get an error that C(1) does not exist. How do I set the collection variables, C and D, back to having a count of 0. Once the clips are found, they always have a count of 1.

Please help.

Vic



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4919 (20100305) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4921 (20100306) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4921 (20100306) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Reply via email to