Foxtable(狐表)用户栏目专家坐堂 → 能不能用For...Next给多个变量赋值?


  共有1802人关注过本帖树形打印复制链接

主题:能不能用For...Next给多个变量赋值?

帅哥哟,离线,有人找我吗?
cbt
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:574 积分:4252 威望:0 精华:0 注册:2015/5/13 8:32:00
  发帖心情 Post By:2017/9/7 12:16:00 [显示全部帖子]

 可以尝试用字典来储存变量!访问 字典的键来取值!
参考:

Dim jzd As new Dictionary(of String,String)
Dim gks() As String = {"rep","cou","sta","cit","key","quoid","soid"}
For i As Integer = 0 To gks.Length - 1
    Dim sz As String =  IIF(1>2,"a",gks(i))
    If jzd.ContainsKey(gks(i))Then
        jzd(gks(i))=sz
    Else
        jzd.Add(gks(i),sz)
    End If
Next

output.show(jzd("rep"))

 回到顶部