以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]请教:想要实现这样的数组,代码该怎么写? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=151869) |
||||||||||||||||||||
-- 作者:无我是天机 -- 发布时间:2020/7/6 14:43:00 -- [求助]请教:想要实现这样的数组,代码该怎么写?
如何将上面datatable中的内容输出为如下格式的数组: [[0,0,90],[0,1,80],[0,2,95],[0,3,100],[1,0,92],[1,1,100],[1,2,85],[1,3,88],[2,0,70],[2,1,90],[2,2,92],[2,3,60]]
|
||||||||||||||||||||
-- 作者:有点蓝 -- 发布时间:2020/7/6 14:56:00 -- dim aa() as string = {"语文","数学","英语"} for j as integer = 0 to aa.length -1
for i as integer = 0 to tables("A").rows.count - 1 output.show(i &"," & j & "," & tables("A").rows(i)(aa(j))) next next |
||||||||||||||||||||
-- 作者:无我是天机 -- 发布时间:2020/7/7 9:16:00 -- 谢谢蓝老师及时回复。请老师再帮忙看看怎么用JArray把它变成如下的数组。谢谢! [[0,0,90],[0,1,80],[0,2,95],[0,3,100],[1,0,92],[1,1,100],[1,2,85],[1,3,88],[2,0,70],[2,1,90],[2,2,92],[2,3,60]]
|
||||||||||||||||||||
-- 作者:有点蓝 -- 发布时间:2020/7/7 9:23:00 -- Dim ja As New JArray Dim ja2 As JArray Dim aa() As String = {"语文","数学","英语"} For j As Integer = 0 To aa.length -1 For i As Integer = 0 To Tables("A").rows.count - 1 ja2 = new JArray ja2.Add(i) ja2.Add(j) ja2.Add(Tables("A").rows(i)(aa(j))) ja.Add(ja2) Next Next |