03-19-2012 08:25 AM
I want to include in a script a progress bar. So I want a new dialog box ( or message or window) to pop up and give current progress status while my main script is running. Looks like visual basic has "Microsoft Windows Common Controls" which would be able to do this. How do I access "Microsoft Windows Common Controls" from inside Diadem? Is there a Diadem example for doing this?
03-19-2012 01:08 PM - edited 03-19-2012 01:09 PM
Because common controls are no available on every machine it might be a good idea to use the DIAdem build in Progress Bar.
From DIAdem help:
Dim intLoop Call LoopInit() For intLoop= 1 To 100 Call LoopInc(intLoop) Call Pause(0.1) Next Call LoopDeInit()
There is also the DIAdem status bar:
Dim Sum, I Sum = 0 Call MsgLineDisp("Calculation starts") For I = 1 To 1000 Sum = Sum + I Call MsgLineDisp("Actual value: " & I)
Call Pause(0.1)
Next Call MsgBoxDisp("Sum of values: " & Sum)
03-19-2012 01:20 PM
And there is the ability to use message dialogs that do not stop the script:
Dim Sum, I Sum = 0 Call MsgLineDisp("Calculation starts") For I = 1 To 10 Sum = Sum + I Call MsgBoxDisp("Actual value: " & I, "MB_NOBUTTON", "MsgTypeNote",, ,TRUE) Call Pause(0.5) Next Call MsgBoxDisp("Sum of values: " & Sum, "MB_NOBUTTON", "MsgTypeNote",, 5,TRUE)
03-19-2012 02:31 PM
Are you saying that the options listed in your first response do actually stop the main script?
03-19-2012 03:02 PM
No noe of this options stop the script. They just give status information. But a normal vbs MsgBox would stop the script.
03-23-2012 02:32 PM
I am already using MsgLineDisp, but this really doesn't capture what I am trying to do. I want a progress bar.
So, AndreasK did give me information about MsgLineDisp, but one of my main questions was "How do I access "Microsoft Windows Common Controls" from inside Diadem?". AndreasK stated ""no available on every machine" which I assume means he is concerned whether Microsoft Windows Common Controls is available on every machine.
But, let's assume for a moment that it was "available". If it were, how do I go about accessing it inside Diadem?
If I were using "Microsoft Word", I would go to the Microsoft Visual Basic portion and click on TOOLS | REFERENCES and select it from the list of checkboxes.
How do I acquire access to these libraries from inside Diadem?
03-24-2012 03:08 AM
Hello, the common controls are available as ActiveX in DIAdem Sud.
They are inserted by Pressing the Button with the red X.
Afterwards you can insert
Microsoft ProgressBar Control, version 6.0
Use Code like this to show progress where progressbar is the name of the control element inside the SUD dialog.
But still there is an issue. The common controls are not available/licensed on every windows machine.
If there is no MS Office your DIAdem SUD will just contain empty space.
Sub start_EventClick(ByRef This) 'Created Event Handler dim maxcount : maxCount = 100 dim i : for i = 1 to maxCount Pause 0.1 progressbar.X.Value = i / maxCount * 100 Next End Sub
03-27-2012 07:05 AM
"inside the SUD dialog"?
What is SUD. Not familiar with this term.
03-27-2012 10:38 AM
Hello Colin,
SUD = Scriptable User Dialog.
You get access to these in DIAdem SCRIPT via this icon:
Hope that helps,
Otmar
03-27-2012 12:34 PM
Thanks. That may prove handy. I was thinking your answer might be different. So, let me explain what I expected. What I thought you would give me is the steps to do what I can do in Microsoft Word. If I hit ALT-F11, the Microsoft Visual Basic Window opens. On the menu, I hit Tools|References. From there, I can see many visual basic libraries. So, now that you have explained how to use the SUD, can you tell me if there is a way to utilize other visual basic libraries inside Diadem?