• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 22. Optimizing Scripts > Using a Case Statement

Using a Case Statement

You have now created four handlers that control the movement of the robot arm on the stage through Lingo, and you have streamlined the code in each of them by using variables. In this task, you'll see how you can streamline the code even more by using a conditional structure, which enables you to create a script that chooses among two or more actions according to the condition that exists at that time.

You have already used simple conditional structures in the form of if-then-else statements. The conditional structure you will use in this task, the case statement, uses the same basic idea as if-then-else statements, but it streamlines the code when you are testing for multiple conditions.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint