Case

  • Scroll to top of this topic Scroll to Top of Page

  • Print the current topic Print Topic

  • No expanding elements on this page Show/Hide Expanders

Case(Index, Result1, Result2, ...). Case uses Index to determine which of the Result1, Result2... arguments will be returned as a result. If Index equals 1, Result1 is returned; if Index equals 2, Result2 is returned; if Index equals 3, Result3 is returned; and so forth. Only “Index”, constant expressions, and the result that is returned will be evaluated. The types of Result1, Result2... must all be the same but they can be of any type. The type that is returned will be the same as the type of Result1, Result2, ...