Checking if a value is a member of a list

前端 未结 3 2083
自闭症患者
自闭症患者 2021-02-19 16:09
  • I have to check a piece of user input against a list of items; if the input is in the list of items, then direct the flow one way. If not, direct the flow to another.
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-19 16:39

    Just use the Select Case with a list:

    Select Case entry
       Case item1,item2, ite3,item4 ' add up to limit for Case, add more Case if limit exceeded
          do stuff for being in the list
       Case Else
          do stuff for not being in list
    End Select
    

提交回复
热议问题