User Tom Ba ( posted:

Sub Main
Dim Result As Integer
dim iWaitTime as integer
dim lStartTime as long
dim iReCheckTime as integer
dim iElapsedTime as integer
dim sExpectedValue as string
dim sActualValue as string
dim sControlObjRec as string

'Where are we going on Planet Quark, today?

'Please verify blaster is ready
sExpectedValue = "Enabled"

'Exactly which control is that, numbskull?
sControlObjRec =
"\;Type=Window;Name=frmMainMDI;\;Type=Window;Name= ACME;\;Type=PushButton;Name=DisIntegrator

'How long do you want to wait before giving up and using water gun?
iWaitTime = 10 'seconds

'Lastly, please specify (in mparsec) how long between successive
iReCheckTime = 100 'e.g., one-tenth of a second

'Begin counting
lStartTime = Timer

Select Case ucase(sExpectedValue)
sExpectedValue = "-1"
sExpectedValue = "0"
sExpectedValue = "1"
Case Else
'Let it be
End Select

result = SQAGetProperty (sControlObjRec, sExpectedValue,
If Instr(lcase(sActualValue),lcase(sExpectedValue)) > 0 Then
'you found it, stop looking already
exit do
'What, didn't find it? Chill. Maybe try again.
DelayFor iReCheckTime
end if
Loop until lStartTime + iWaitTime <= Timer

'Now invoke your compare mechanism du jour, actual v. expected

End Sub
----Original Message Follows----
Reply-To: "SQA Suite Team Test Users" <>
To: "SQA Suite Team Test Users" <>
Subject: RE: SQAWaitforPropertyValue
Date: Wed, 27 Mar 2002 20:18:45 +0530

In my opinion it will be better to put some delay in each iteration of the
- like Delayfor(1000). A continuous loop eats up so much processor time that
the process which will make the required value avialble in the field under
test, will get very little processor time to do the job.


__________________________________________________ _______________
Join the world’s largest e-mail service with MSN Hotmail.