Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 10 of 10
  1. #1
    Join Date
    May 2003
    Posts
    11

    Another Conditional Question...sorry

    I just upgraded from SF6. I have several projects that used a run time condition built in the conditional dialog box in sf6 that allowed me to set whether or not certain files were installed based on a radio button setting.
    The dialog was painless.
    If %radioselection%=option1 type stuff...

    I have imported those SF6 jobs, and now it seems as though I will have to create some kind of conditional code instead of using that conditional dialog to set the run time conditions.
    I have read through some of the threads here...but I am still confused.

    Thanks,
    Greg

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi Greg, what is your question?

  3. #3
    Join Date
    May 2003
    Posts
    11
    My question is:
    How do I set a run time condition of something like "if radiobutton1 is checked then install this file".

    Thanks,
    Greg

  4. #4
    Join Date
    Jan 2000
    Posts
    2,002
    First of all, take a look at the Radio Buttons screen. See the field called "Store result in session variable:"? That field allows you to define a session variable that will store the radio button control ID. Control IDs are those items that look like this: CTRL_RADIO_BUTTON_01 beside each item. So, if the user chooses Option 3 (in the case of the default Radio Buttons screen) %RadioSelection% will be set to CTRL_RADIO_BUTTON_03.

    So, if you want to conditionally install a file based on this value, double click the file to open its file properties and go to the Conditions tab. See the field called "Script Condition"? That is where you will put the condition that will evaluate the result of the radio button screen. Sinve the result is stored in a session variable, we will need to expand it and then ompare the result. So, for example you could enter something like this in that field:

    SessionVar.Expand("%RadioSelection%") == CTRL_RADIO_BUTTON_01

    to only install the file if the user chose the first radio button option. Hope that helps.

  5. #5
    Join Date
    May 2003
    Posts
    11
    Brett,
    That helped quite a bit! Thank you. I have also been reading the users guide this morning.

    For an opinion, I think that the script language is very powerful, and has quite a few useful features. I also believe that the SF6 menu choices for the variables that already existed instead of typing them all out. It kept me from switching screens back and forth looking for the right one.

    But, I am learning...and that is always a plus.

    Thanks,
    Greg

  6. #6
    Join Date
    May 2003
    Posts
    11
    I have tried, specifically, that type example to see if the files will indeed install if I select Button1 and they do not.
    I do not get an error anymore with the condition statement in there, but none of the files with the condition of SessionVar.Expand("%RadioSelection%") == CTRL_RADIO_BUTTON_01
    install when button 1 is selected. Any files without a condition install to the proper location.

    Any ideas why this will not work?

    Thanks again...
    Greg

  7. #7
    Join Date
    Feb 2005
    Posts
    3

    My method of doing what you want

    I admit I am a noob and I am bad at programing so there may be a way to use less code, but this is how I handle radio buttons.

    Open the screen that contains your radio buttons. Place something like the following into your ON NEXT actions area:


    -- check which radio button was choosen
    nSelectedControl = String.ToNumber(SessionVar.Expand("%RadioSelection %"));
    if (nSelectedControl == CTRL_RADIO_BUTTON_01) then
    RadioChoice = 1;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_02) then
    RadioChoice = 2;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_03) then
    RadioChoice = 3;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_04) then
    RadioChoice = 4;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_05) then
    RadioChoice = 5;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_06) then
    RadioChoice = 6;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_07) then
    RadioChoice = 7;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_08) then
    RadioChoice = 8;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_09) then
    RadioChoice = 9;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_10) then
    RadioChoice = 10;
    elseif (nSelectedControl == CTRL_RADIO_BUTTON_11) then
    RadioChoice = 11;
    end

    -- advance to the next screen
    Screen.Next();


    Then, where ever you want to test which button was choosen you can do either:

    A}

    if (RadioChoice == 1) then
    -- do something
    end

    +++OR+++
    B} to use as conditions in the individual file properties screen

    RadioChoice == 1

    change 1 to the number you want.

    Hope this helps
    Josh

  8. #8
    Join Date
    Apr 2005
    Posts
    3
    Quote Originally Posted by GregSS
    I have tried, specifically, that type example to see if the files will indeed install if I select Button1 and they do not.
    I do not get an error anymore with the condition statement in there, but none of the files with the condition of SessionVar.Expand("%RadioSelection%") == CTRL_RADIO_BUTTON_01
    install when button 1 is selected. Any files without a condition install to the proper location.

    Any ideas why this will not work?

    Thanks again...
    Greg

    Put then in the "on next" action for the radio buttons screen
    Code:
    -- Expand the session variable %RadioSelection%.
    strRadioSelection = SessionVar.Expand("%RadioSelection%");
    
    -- Convert the selected radio button control to a number for the comparison.
    nSelectedControl = String.ToNumber(strRadioSelection);
    for the "script condition" in file properties use

    nSelectedControl == CTRL_RADIO_BUTTON_01
    or
    nSelectedControl == CTRL_RADIO_BUTTON_02
    or
    nSelectedControl == CTRL_RADIO_BUTTON_03
    or
    nSelectedControl == CTRL_RADIO_BUTTON_04

    and so on

  9. #9
    Join Date
    Dec 2004
    Location
    Omaha, Nebraska
    Posts
    9
    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...
    Code:
    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
    Code:
    French
    or

    Code:
    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

    Code:
    French AND 2000
    Code:
    (French) AND (2000 = TRUE)
    Code:
    (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...

  10. #10
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,861
    is this a suf6 or suf7/8 question?
    You posted in both places...

    you should start a new thread either way; reviving such an old tread just will confused the issue(s).

    Assuming a suf6 (since that makes more sense)

    2000 will never be true or false -- it will always be 2000

    Try changing yoru variables to PowerPoint20000 Or better
    PowerPointVersion = 2000;

    then check

    English and PowerPiontVersion==2000
    Last edited by jassing; 10-14-2008 at 09:00 AM.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

Similar Threads

  1. question about sound mp3
    By Rapido78840 in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 10-10-2003, 11:19 AM
  2. Need Assistance with Random Question Quiz
    By marc3515 in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 02-16-2003, 06:25 AM
  3. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 AM
  4. Conditional exit
    By Giorgio in forum Setup Factory 5.0
    Replies: 1
    Last Post: 04-05-2001, 10:44 AM
  5. ** Question for all AutoPlay Menu Studio Users **
    By Ted in forum AutoPlay Menu Studio 3.0
    Replies: 4
    Last Post: 10-09-2000, 09:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts