namedajipai
namedajipai
2016-11-21 12:58
采纳率: 90.6%
浏览 1.4k
已采纳

vb编程语言中怎么通过获取一个变量的值去算它在数组中下标的integer值?

vb编程语言中怎么通过获取一个变量的值去算它在数组中下标的integer值?获取下标integer值的代码怎么思路?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • caozhy
    已采纳
    点赞 评论
  • Tiger_Zhao
    Tiger_Zhao 2016-11-30 03:46
        Dim a()     As Long
        Dim v       As Long
        Dim i       As Long
    
        ReDim a(1 To 3)
        a(1) = 100
        a(2) = 300
        a(3) = 200
        v = 300
    
        For i = 1 To 3
            If a(i) = v Then
                Debug.Print "找到下标:" & i
                Exit For
            End If
        Next
    
    点赞 评论

相关推荐