Apple Final Cut Pro 5 User Manual Page 280

  • Download
  • Add to my manuals
  • Print
  • Page
    / 376
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 279
280 Chapter 16
Conditional Statements
A conditional statement says that something should happen if a certain condition is met.
Conditional statements always begin with
if and end with end if.
This example comes from the Bevel filter script, which places a beveled border around the
picture.
if framewidth<frameheight
framemin=framewidth;
framemax=frameheight;
else
framemin=frameheight;
framemax=framewidth;
end if;
This statement is conditional upon the values of two variables, framewidth and frameheight.
It changes the values of two other variables, framemin and framemax, depending upon the
relative values of the variable pair mentioned in the conditional statement.
You can add more conditions by placing else if clauses into the conditional statement.
Each
else if clause allows you to add one more condition to the statement.
The
else clause means “in all other cases not covered by the previous condition or
conditions.” It is not essential to place
else statements in scripts unless you want to specify
what should happen if none of the conditions are met.
Input Statements
Input statements are extremely powerful and versatile. They enable you to place user
controls into a script, so that an effect can be finely adjusted. The user controls appear in the
Input controls tab in the FXBuilder window, and also in the Viewer when a script is added to
the Timeline for a sequence.
There are several types of input control. You can choose the type of control that meets the
needs of the script most closely. You can have more than one input control in a script; some
have three or four.
Loops
A loop is a section of code that repeats, usually according to certain conditions specified by
the needs of the script. There are two basic types of loops in FXScript: the For/Next loop
and the Repeat/End Repeat loop, which has several specific forms.
Page view 279
1 2 ... 275 276 277 278 279 280 281 282 283 284 285 ... 375 376

Comments to this Manuals

No comments