Bungee Logic : Statement : If Condition

From $1

Back to Bungee Logic Statements

Description

Evaluates a series of one or more cases, similar to a switch statement.
The evaluation terminates when a case is satisfied.

Syntax

condition{ case(expression){} [case(expression){}] [default{}] }

Where:

expression Is an expression that evalutates to true or false.

Logic

 The simplest form of a condition statemment holds a single case statement.  In this case it is similar to an IF statement in functionality.

condition

{

   case(true_false_expression)

   {

      // True logic goes here

   }

};

 

 It is even possible to create an IF THEN ELSE statement by selecting and utilizing the Handle Default property as shown here.

condition

{

   case(true_false_expression)

   {

      // True logic goes here

   }

   default

   {

      // Else logic goes here

   }

};

 

And of course, a multitple SWITCH/CASE statement can be created (with default handling) as illustrated below.

condition

{

   case(Answer==option_1)

   {

      // Option One Code

   }

   case(Answer==option_2)

   {

      // Option Two Code

   }

   case(Answer==option_3)

   {

      // Option Three Code

   }

   default

   {

      // Error Handling Logic goes here

   }

};

 

Error Handling

-None-

Intrinsics

-None-

Properties

  • case — Evaluates an expression and executes a block of code if the Case expression evaluates to true.
  • Handle Default — Create an intrinsic case, called default, that is executed when no other case is satisfied.

Tab Title Bar

Tags:
 
Images (0)
 
Comments (0)
You must login to post a comment.