how to show a message according to some conditons?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
caomeisanhao
Junior Coder
Posts: 28
Joined: Wed Jun 08, 2005 2:48 pm

how to show a message according to some conditons?

Post by caomeisanhao » Tue Jun 28, 2005 3:25 pm

Hi,guys
I want to show a message according to some conditons.
so I use the function "dialog" as someone says in the forum.
I set 4 Checkbox to let the user to choice if a software will be installed or not.
and :
if>Dialog.MycheckBox1=True, install1
if>Dialog.MycheckBox2=True, install2
if>Dialog.MycheckBox3=True, install3
if>Dialog.MycheckBox4=True, install4
...
...

after the install I want a message coming out to show which the user has installed,just like a mini report. (the users always do multi choice)
how should I do? Please help!

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

Post by JRL » Tue Jun 28, 2005 5:54 pm

Judging by your next post, you may have already figured this out but since you posed the question, it deserves an answer. I will also incorporate Luciano's solution to your next post.

There are so many possibilities, but as long as you have version 7.3 or higher installed you can use complex "If" statements. Try something like this:

Let>waittime=5

if>Dialog.MycheckBox1=True
message>Checkbox 1 selected
Wait>%waittime%
CloseWindow>Macro Scheduler Message
goto>install1
EndIf

if>Dialog.MycheckBox2=True
message>Checkbox 2 selected
Wait>%waittime%
CloseWindow>Macro Scheduler Message
goto>install2
EndIf

if>Dialog.MycheckBox3=True
message>Checkbox 3 selected
Wait>%waittime%
CloseWindow>Macro Scheduler Message
goto>install3
EndIf

if>Dialog.MycheckBox4=True
message>Checkbox 4 selected
Wait>%waittime%
CloseWindow>Macro Scheduler Message
goto>install4
EndIf

Hope this was helpful,
Dick

caomeisanhao
Junior Coder
Posts: 28
Joined: Wed Jun 08, 2005 2:48 pm

thanks!

Post by caomeisanhao » Wed Jun 29, 2005 7:13 am

thanks a lot!
it is a good idea.but can I let the messages be showed after installing for all software that the user choices.I mean, can I put the 4 message in one message box ? that will be nicer? but how... :)

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 » Wed Jun 29, 2005 12:05 pm

Rather than displaying a message, make a string to be displayed later on.
Something like this?

Code: Select all

If>Dialog.MycheckBox1=True
Let>MsgString=Checkbox 1 selected
Wait>%waittime%
CloseWindow>Macro Scheduler Message
goto>install1

Label>install1
Do stuff.......
Message>%MsgString%

EndIf 
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

caomeisanhao
Junior Coder
Posts: 28
Joined: Wed Jun 08, 2005 2:48 pm

thanks!bur

Post by caomeisanhao » Thu Jun 30, 2005 9:03 am

hello,
yes , with your idea I can let a message coming out when the install finished,but when the user chose 3 software of 4,and after the whole install , I want to show a message with words " A,B,C is installed",not for each of them, I need one message window comingout contains a list of softwarename,which the user has installed. not three message windows for each of the 3.

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

Post by JRL » Thu Jun 30, 2005 2:23 pm

If I understand you correctly, you want one message at the end to reflect the choices made in your dialog box regarding one to all of the options selected. Note, using subroutines rather than labels for install1 thru 4.

Try something like this:

Let>MsgString=
If>Dialog.MycheckBox1=True
Concat>MsgString,Text about software 1%CRLF%
If>Dialog.MycheckBox2=True
Concat>MsgString,Text about software 2%CRLF%
If>Dialog.MycheckBox3=True
Concat>MsgString,Text about software 3%CRLF%
If>Dialog.MycheckBox4=True
Concat>MsgString,Text about software 4

if>Dialog.MycheckBox1=True,install1
if>Dialog.MycheckBox2=True,install2
if>Dialog.MycheckBox3=True,install3
if>Dialog.MycheckBox4=True,install4

SRT>install1
//install stuff
End>install1

SRT>install2
//install stuff
End>install2

SRT>install3
//install stuff
End>install3

SRT>install4
//install stuff
End>install4

Message>%MsgString%

Hope this helps,
Dick

caomeisanhao
Junior Coder
Posts: 28
Joined: Wed Jun 08, 2005 2:48 pm

you are beautiful!

Post by caomeisanhao » Fri Jul 01, 2005 10:48 am

you are everything I hope for,you areeeee everything I neeeeeeeed,you are so beautiful to me,caaaaaaaaaaannot you seeeeeee...(Stop!)

Thanks a lot,it works!

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