Torabi Architect.
Mathsurf Documents Dec 2008
arrowAdd condition.
Condition Dialog

Conditional statements simply tell MAX-Script to perform a specified command if a certain condition is met. You can use both “If … then…” statement and “Case expression” statement inside the function by using “Add condition” button.

 


Condition Dialog:  lets you to define new conditional statement or edit existing conditional statement.
To make a “If…Then…” statement select “If” radio button and set the condition. The condition value should be a Boolean value. For example in the statement of

If A>1 do (…)” condition is “A>1”.

If the “If” statement include an “else” statement the “Else” option must be active. In this case you will get two new rollouts in the function definition. First one will include commands which will perform when the condition met and second rollout includes commands that should perform when condition is false.

 

There is another conditional statement in Max-script that we are able to use in Mathsurf.To make a “Case expression”, select the case in the dialog. Basically in “Case expressions” we have a value or expression which will evaluate in different cases. The expression should locate in “Case of” .to define cases type the case in front of “+” button and press it. for example to have a statement like:
Case (A+B) of (
                1: (…)
                2:(…)
)

We set “Case of” to “A+B” and add “1” and “2” into Cases by using “+” button. The structure of Conditional statement has been created in this stage. Depend on number of cases has been made Mathsurf will generate new sub-rollouts inside a “Case” rollout. To define the commands that must be executed in each case we use the new controls in the specific rollout. As well as loop rollout we have three controls in each condition rollout.

  Case Dialog

Edit Button: brings the “Condition” dialog with existing conditions. You can edit the Condition’s parameters.
Note 1: To edit cases in “Case expression” use Edit Button button from top level. Select the specific case from the list. It appears in the field above. You can change the expression and use Plus Button button to replace with the old one.
Note 2: if you uncheck an “Else” option, it will remove the “Else” statement. It has same effect as you press Remove Button button in the “Else” rollout.      
Remove Button: will remove the conditional statement but it will keep the commands inside it. If you delete an “If” all operations inside that will be appear in same place.
Note 1: if you delete a “Case expressions” in top level it works like “If” statement.
Note 2: for each “Case” there is one Remove Buttonbutton that removes the specific “Case” including all commands inside it.
Drop Down Menu: lets you insert new commands into the current conditional statement.

 

Condition Rollout
arrowFunction Definition Dialog.
arrowFormoula Definition.
arrowPlug-in features.
arrowBack to Index
www.torabiarchitect.com