Choose Function

рдЖрд░реНрдЧреБрдореЗрдиреНрдЯ рд╕реВрдЪреА рдореЗрдВ рд╕реЗ рдЪрдпрдирд┐рдд рдореВрд▓реНрдп рдХреЛ рд╡рд╛рдкрд╕ рдХрд░рддрд╛ рд╣реИ.

Syntax:


Choose (Index, Selection1[, Selection2, ... [,Selection_n]])

рдкреИрд░рд╛рдореАрдЯрд░

Index: A numeric expression that specifies the value to return.

Selection1: Any expression that contains one of the possible choices.

The Choose function returns a value from the list of expressions based on the index value. If Index = 1, the function returns the first expression in the list, if index i= 2, it returns the second expression, and so on.

If the index value is less than 1 or greater than the number of expressions listed, the function returns a Null value.

The following example uses the Choose function to select a string from several strings that form a menu:

Error codes:

5 Invalid procedure call

рдЙрджрд╛рд╣рд░рдг:


Sub ExampleChoose
Dim sReturn As String
    sReturn = ChooseMenu(2)
    Print sReturn
End Sub
 
Function ChooseMenu(Index As Integer)
    ChooseMenu = Choose(Index, "Quick Format", "Save Format", "System Format")
End Function