Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Apple Guide Complete / Part 4 - Scripting Guide Files
Chapter 10 - Guide Script Command Reference / Guide Script Command Descriptions
/ Specifying Conditional Execution


<End If>

You use the <End If> command to specify the end of a sequence of commands in a conditional execution.

<End If> 
DESCRIPTION
You can use the <End If> command, in combination with an <If> command, to specify conditional execution of one or more commands. You can also use an <Else> command with an <If> command. Apple Guide executes the statements between an <If> command and an <End If> (or <Else>) command only if the condition evaluates to TRUE. Apple Guide executes the statements between an <Else> command and an <End If> command only if the condition evaluates to FALSE.

This is the general structure of conditional execution:

   <If> condition
      statement(s)      #executed if true
   <Else>
      statement(s)      #executed if false
   <End if>
SPECIAL CONSIDERATIONS
Every <If> command must be balanced with a corresponding <End If> command. You cannot nest <If> commands more than four levels deep.

EXAMPLES
<Define Sequence> "How do I create an index?"
   <Panel> "1st panel always display"
   <If> radioButtonState("Book Index", "1st panel always display")
      <Panel> "Panel 2 if true"
      <Panel> "Panel 3 if true"
   <Else>
      <Panel> "Panel 2 if false"
      <Panel> "Panel 3 if false"
   <End if>
   <Panel> "last panel always display"
<End Sequence>
<Define Sequence> "How do I create an index?"
   <Panel> "Index Choices 2"
   <If> radioButtonState("Book Index", "Index Choices 2")
      <Sequence> "How do I create a book index?"
   <Else>
      <Sequence> "How do I create a chapter index?"
   <End if>
<End Sequence>
SEE ALSO
For information on the <If> and <Else> commands, see page 10-153 and page 10-156, respectively.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
12 JUL 1996