Choose Function
μΈμ λͺ©λ‘μμ μ νν κ°μ ꡬν©λλ€.
ꡬ문:
Choose (Index, Selection1[, Selection2, ... [,Selection_n]])
λ§€κ° λ³μ:
Index: ꡬν κ°μ μ§μ νλ μ«μ μμ λλ€.
Selection1: κ°λ₯ν μ ν νλͺ© μ€ νλλ₯Ό ν¬ν¨νλ μμμ μμ λλ€.
Choose ν¨μλ μμΈ κ°μ κΈ°μ΄νμ¬ μ λͺ©λ‘μμ κ°μ ꡬν©λλ€. μλ₯Ό λ€μ΄, μμΈ = 1μΌ κ²½μ° λͺ©λ‘μ 첫 λ²μ§Έ μμ΄ κ΅¬ν΄μ§λ©°, μμΈ = 2μΌ κ²½μ° λ λ²μ§Έ μμ΄ κ΅¬ν΄μ§λλ€.
μμΈ κ°μ΄ 1λ³΄λ€ μκ±°λ λμ΄λ μ μλ³΄λ€ ν΄ κ²½μ° Null κ°μ΄ ꡬν΄μ§λλ€.
λ€μμ Choose ν¨μλ₯Ό μ¬μ©νμ¬ λ©λ΄λ₯Ό ꡬμ±νλ μ¬λ¬ λ¬Έμμ΄μμ λ¬Έμμ΄μ μ ννλ μμ λλ€.
μ:
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