Jump to content

Loop question


rosaz
 Share

Recommended Posts

I know this must have a simple answer, but I can't quite get it to work- I want to the script to keep checking a field until it is no longer blank, and then to create a message box. So far I have:

$ShortDescription = $oRemedyForm.GetField("Short Description")

While $Phone = ""

WEnd

MsgBox(1, "", "Ready To Save?")

Thank you in advance for any suggestions!

Link to comment
Share on other sites

I know this must have a simple answer, but I can't quite get it to work- I want to the script to keep checking a field until it is no longer blank, and then to create a message box. So far I have:

$ShortDescription = $oRemedyForm.GetField("Short Description")

While $Phone = ""

WEnd

MsgBox(1, "", "Ready To Save?")

Thank you in advance for any suggestions!

I'm not too sure exactly what you are looking to do.. I'm assuming check a text box or something?

Do
   sleep(20)
Until $oRemedyForm.GetField <> ""
Link to comment
Share on other sites

this:

While 1
    if $phone<>"" then 
        ;do whatever u want
    EndIf
WEnd
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Link to comment
Share on other sites

I know this must have a simple answer, but I can't quite get it to work- I want to the script to keep checking a field until it is no longer blank, and then to create a message box. So far I have:

$ShortDescription = $oRemedyForm.GetField("Short Description")

While $Phone = ""

WEnd

MsgBox(1, "", "Ready To Save?")

Thank you in advance for any suggestions!

You have to go back and get the information each time. Where is $Phone being updated?

While True                                  ; Always loop
    $Check = $oCustomer.GetField("Phone")   ; Get the value to check
    If $Check > "" Then ExitLoop            ; Leave the loop if $Check is not blank.
    Sleep(1000)                             ; Wait about 1 second.  This is to keep the processor from working too hard.
Wend                                        ; Go back to the While statement and check again.
MsgBox(48, "Testing", $Check)

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...