Multiple Combo boxes, how ?

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Aug 18, 2005 6:10 am

Great work dick (JRL).


You have created "radio buttons" made up of combo boxes. And thanks to mydave for coming up with the original idea.

This could actually be a new type of object in the forms design world. Not sure how I would use this yet, but I think it has to have some potential. The result is no different than selecting from a single combo box with a long list of options, but can be filtered somehow.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

mydave
Junior Coder
Posts: 39
Joined: Fri Jul 22, 2005 12:42 pm

Post by mydave » Thu Aug 18, 2005 6:34 am

WOW, this is definitely the one.
I tried several times and it worked just like the previous one. The result looks as follows:

8/18/2005 - Box1 selvar_2 was selected.
8/18/2005 - Box2 selvar_3 was selected.
8/18/2005 - Box3 selvar_4 was selected.
8/18/2005 - Box1 selvar_2 was selected.
8/18/2005 - Box2 selvar_3 was selected.
8/18/2005 - Box3 selvar_4 was selected.
8/18/2005 - Box1 selvar_2 was selected.
8/18/2005 - Box2 selvar_3 was selected.
8/18/2005 - Box3 selvar_4 was selected.

Although the new script is way over my head, but I think I can manage it and fit it for real life app. The %Selection% in the WriteLn statement was very thoughtfull, thanks greatly.

Again, I am much obliged and gratefull.

P.S. I would like to suggest that Support to add this script to the selection of examples and in your help file of next release.
[/quote]

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Aug 18, 2005 2:37 pm

mydave and Bob,
Thanks for the praise. It's unneeded but I appreciate it.

mydave,
There is a problem with the results you posted. Your C:\temp\test.txt file results are showing the variable "selvar_x" rather than the results of the variable "selvar_x".

When I run this script my test.txt file looks like this:

08/18/2005 - Box3 Line 3 was selected.
08/18/2005 - Box2 Line Second was selected.
08/18/2005 - Box1 Line One was selected.

Yours looks like this:
8/18/2005 - Box1 selvar_2 was selected.
8/18/2005 - Box2 selvar_3 was selected.
8/18/2005 - Box3 selvar_4 was selected.
8/18/2005 - Box1 selvar_2 was selected.
8/18/2005 - Box2 selvar_3 was selected.
8/18/2005 - Box3 selvar_4 was selected.
8/18/2005 - Box1 selvar_2 was selected.
8/18/2005 - Box2 selvar_3 was selected.
8/18/2005 - Box3 selvar_4 was selected.
I'm curious as to why this would be. Is it an OS difference? I'm on WinXP Pro SP1. Is it possible that the "VAREXPLICIT" variable default is different on your MS configuration? My VAREXPLICIT=0. Is it a MS version difference? My version is 7.3.11.3

Let me know what you find out. This script may need more tweeking.

Later,
Dick

mydave
Junior Coder
Posts: 39
Joined: Fri Jul 22, 2005 12:42 pm

Post by mydave » Thu Aug 18, 2005 7:33 pm

Hi Dick,

The result that I posted this morning was ran on XP SP2, not sure about MS version, perhaps the same 7.11.3 or 4, but will confirm when I return home tonight.
I copied the exe and ran it in a real domain environment, XP SP1. The sequence of selection is exactly the same in the three times that I tested. Note that the result came out differently. It was erroneous during the first two times. It was correct in the third time when I paused a second or two between the clicks.

First Run:
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
Second Run:
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
Third Run:
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.

It seems that the computer speed can present a problem. As far as why I got selvar in the output file, rather than the actual variable, I will test again tonight and repost.

Again, this script is the very best.

Hi Bob, multicomboboxes like this one allow users to select from a great variety of things, all on one page menu. Combining the tools from MSChd and the creation from Dick, this makes it all possible. Perhaps you have an opportunity to benefit from this someday.

mydave
Junior Coder
Posts: 39
Joined: Fri Jul 22, 2005 12:42 pm

Post by mydave » Fri Aug 19, 2005 12:34 am

Hi Dick,
The version that I ran this morning was 7.3.10.
I updated to the latest 7.3.11.4 and recompiled the exact script.
It fixed the problem as posted in 7.3.10, but the result is not good.
I would expect the result to be like this:

8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line First was selected.
8/18/2005 - Box3 Line 1 was selected.
8/18/2005 - Box1 Line Two was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 2 was selected.
8/18/2005 - Box1 Line Three was selected.
8/18/2005 - Box2 Line Thirst was selected.
8/18/2005 - Box3 Line 3 was selected.

But the actual output got all mixed up, like the followings:

8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
Second run:
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
Third run:
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.
8/18/2005 - Box1 Line One was selected.
8/18/2005 - Box2 Line Second was selected.
8/18/2005 - Box3 Line 3 was selected.

Checking back all the results, it does seem that the result is not as intended.
When I selected box2 Line First, the result is box2 Line Second.
When I selected box3 Line 1, the result is box3 Line 3
When I selected box1 Line Two, the result is box1 Line One
When I selected box3 Line 2, the result is box3 Line 3
When I selected box1 Line Three, the result is box1 Line One
When I selected box2 Line Third, the result is box2 Line Second.
The remaining selections are correct.
Perhaps a little tune up?

Thanks greatly again,

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Aug 19, 2005 2:02 am

mydave,

Just a note to let you know I've read your post. I'll see if after a compile I can replicate the problem. I won't be able to do that until tomorrow. I only have the non pro version at home.

Have you tried more than three boxes yet? Wondering how badly that will mess things up, especially if speed is already an issue.

Ideas or test results from anyone else would be welcome.

Later,
Dick

Edit 1

Try this:

Change the dialog line:
Top=300 to Top=100

Also, toward the end of the script, just after the "writeln" line, add the line:

Message>%time% - %LastChoice% %Selection% was selected.

You should see a message box that changes whenever you select the "Write Result" button. The message should contain the exact text being written to the text file. I'm only running this as a script but I have not yet seen it fail.

Dick

Edit 2

OK, I found an error in the setup for the "WriteLn" so I altered the preposted script. Hopefully Its better now. I also added the lines mentioned above.

Later,
Dick

mydave
Junior Coder
Posts: 39
Joined: Fri Jul 22, 2005 12:42 pm

Post by mydave » Fri Aug 19, 2005 7:48 am

Perfect!
The little modification in the 'checkselection' did the trick.
I tested with multiple boxes and varied amount of selections, and all worked perfectly. The speed does not seem to be a problem neither.

Tested dialog:
ComboBox=Box1,50,30,200,NONE%CRLF%Line 10%CRLF%Line 11%CRLF%Line 12
ComboBox=Box2,50,50,200,NONE%CRLF%Line 20%CRLF%Line 21%CRLF%Line 22%CRLF%Line 23%CRLF%Line 24
ComboBox=Box3,50,70,200,NONE%CRLF%Line 30%CRLF%Line 31%CRLF%Line 32%CRLF%Line 33%CRLF%Line 34%CRLF%Line 22%CRLF%Line 35
ComboBox=Box4,50,90,200,NONE%CRLF%Line 40%CRLF%Line 41
ComboBox=Box5,50,110,200,NONE%CRLF%Line 50%CRLF%Line 51%CRLF%Line 52%CRLF%Line 53%CRLF%Line 54%CRLF%Line 55%CRLF%Line 56%CRLF%Line 57

What can I say, but WOW WOW WOW . . .
And THANKS THANKS THANKS . . . .

Cheers

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts