PDA

View Full Version : Conditional Script for Multiple Variables in File Properties


Ishana
10-13-2008, 06:30 PM
I see posting on how to define a single variable with one screen of radio buttons...but how do I define multiple variables in the script conditions text box in the File Properties?

I have created 2 Radio button screens, one to ask which language (French or English) which I am capturing in %Language% and the other screen to capture which version of PowerPoint they are running (2000 or 2002,2003,2007)

[My PowerPoint Addin is in 2 versions, one for Powerpoint 2000 and one for Powerpoint 2002,2003 or 2007, hence I am leaving it up to user to select which PowerPoint version they have]

on LanguageScreen1 I defined this on Next action after placing 2 radio buttons...

if String.ToNumber(SessionVar.Expand("%Language%")) ==
CTRL_RADIO_BUTTON_01 then
English = true;
French = false;
else
English = false;
French = true;
end


and in the Script conditions textbox defined
French

or

English

and it works fine.

I cant figure out how to have the second condition added in the textbox... is it with an AND and parenthesis? I need some examples please..

I tried the following and it doesnt work

French AND 2000
(French) AND (2000 = TRUE)
(French) AND (2002 = TRUE) OR (2003 = TRUE) OR (2007 = TRUE)

I tried doing it with just 2 radio buttons and also tried with 4 radio buttons (each version of Powerpoint on a separate button)

Some examples would be nice...please..

If someone has an alternative way of doing it, I am open to it.

thank you in advance...

jassing
10-14-2008, 09:45 AM
I'm confused by your question; you talk about screen conditions (there are none in suf7/8) and file properties....

Can you post a sample project wtih what you've tried so we can look at what you're doing?

Ishana
10-14-2008, 11:13 AM
Here is a sample project
in screens, you have 2 radio button screens that capture data...

then in conditions you will see that I tried various ways to selectivly install.

the possible install options are
1. English + Powerpoint 2000
2. English + Powerpoint 2002 or 2003 or 2007
3. French + Powerpoint 2000
4. French + Powerpoint 2002 or 2003 or 2007

and then some common files, which is easy.

hope you follow now...

thanks

jassing
10-14-2008, 04:56 PM
So you are dealing with conditional FILES not screens...
I looked at one file; it's wrong:

French AND OfficeChoice = 2000

should be

French AND OfficeChoice == 2000

Ishana
10-15-2008, 10:35 AM
then how to do multiple conditions in that one text box? Should it be like:

French AND OfficeChoice == 2002 AND OfficeChoice == 2003 AND OfficeChoice == 2007

jassing
10-15-2008, 10:38 AM
then how to do multiple conditions in that one text box? Should it be like:

French AND OfficeChoice == 2002 AND OfficeChoice == 2003 AND OfficeChoice == 2007

OfficeChoice can never equal 2002 AND 2003.

it's one or the other.

Perhaps you mean:

French AND (OfficeChoice == 2002 or OfficeChoice == 2003 or OfficeChoice == 2007)

Ishana
10-15-2008, 11:06 AM
Yes, I really did mean an OR not an AND.

Let me try this and will let you know...

jassing
10-15-2008, 11:24 AM
Yes, I really did mean an OR not an AND.

Let me try this and will let you know...

Just remember to use the parenthesis ....

Ishana
10-15-2008, 11:43 AM
Still getting error...

jassing
10-15-2008, 11:48 AM
it's and not AND
it's or not OR
be sure to use == not =

Ishana
10-15-2008, 12:11 PM
That worked! it was the Upper Case "AND" that was causing the problem.

From my experience, Boolean operators are defined in UPPER CASE...why this different?

thank you for your help...

worked out perfectly!

jassing
10-15-2008, 04:44 PM
That worked! it was the Upper Case "AND" that was causing the problem.

From my experience, Boolean operators are defined in UPPER CASE...why this different?

thank you for your help...

worked out perfectly!

Because that's how the designers of the LUA scripting language decided it should be.