Solved

How to you post multiple messages in the same MessageBox in AutoIt

Posted on 2014-01-25
3
614 Views
Last Modified: 2014-01-25
I want to post a status message in a single box as status changes throughout the process of my code.  Here is an example

        MsgBox(48, "DB Connect", "Connecting to DB 1", 2)

      MsgBox(48, "DB Connect", "Connect to DB 2", 3)

      MsgBox(48, "DB Connect", "Connect to DB 3", 4)

      MsgBox(48, "DB Connect", "Successfully Connect to all DB", 3)

This produces 4 different messages boxes and an OK option in each one.  I would like to create a single box.  Then print the message "Connecting to DB 1", after my process completes and goes on to the next one, in the same message box just on the line below, I want to say "Connecting to DB 2", when task completes, I want to say "Connecting to DB 3" on the next line below.  Next I will show "Successfully connected to all DB's".  I do not really need an OK option at all.  I just want to know that I successfully executed the task.  The task may not be connecting to a database but something completely different.  I just want to be able to show progress with status messages in one box.  Does anyone have any ideas how to complete this task.  Any help is greatly appreciated.

Thanks
0
Comment
Question by:kwh3856
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:kwh3856
ID: 39809205
Ok... found a better way to do this but now I want to show different messages at certain percentages of the progress bar.  How can I do that with this code?


ProgressOn("DB Connect", "Obtaining Data from System", "0%")

    ; Update the progress value of the progress bar window every second.
    For $i = 10 To 100 Step 10
        Sleep(1000)
        ProgressSet($i, $i & "%")
    Next

    ; Set the "subtext" and "maintext" of the progress bar window.
    ProgressSet(100, "Done", "Data  Ready To Send")
    Sleep(5000)

    ; Close the progress window.
    ProgressOff()
0
 
LVL 8

Accepted Solution

by:
TheNautican earned 500 total points
ID: 39809406
Maybe try something like this....

ProgressOn("DB Connect", "Obtaining Data from System", "0%")

    ; code to connect to databasesw and do stuff
      ; you'll have to manually figure out what percentages to set
      ; your progress bar like so

      ProgressSet(10, "Connecting to Database 1", "Please wait...")
      Sleep(1000) ; Just for test but here is where you'd connect and do stuff
      ProgressSet(25, "Connecting to Database 2", "Please wait...")
      Sleep(1000) ; Connect to a database and to do stuff
      ProgressSet(50, "Connecting to Database 3", "Please wait...")
      Sleep(1000) ; Connect to a database and to do stuff
      ProgressSet(75, "Connecting to Database 4", "Please wait...")
      Sleep(1000) ; Connect to a database and to do stuff

    ; Set the "subtext" and "maintext" of the progress bar window.
    ProgressSet(100, "Done", "Data  Ready To Send")
    Sleep(5000)

    ; Close the progress window.
    ProgressOff()

Regards,
-Naut
0
 

Author Closing Comment

by:kwh3856
ID: 39809680
That was exactly what I needed.  Thanks.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question