标题: DATATABLE里的列名作为变量? [打印本页] 作者: FLY000 时间: 2009-2-9 16:14 标题: DATATABLE里的列名作为变量? For i= 1 to nRowAdd
'Call InitDatatable(add,nRowAdd,nColumnAdd)
DataTable.Getsheet("add").SetCurrentRow(i)
ClickDep=DataTable.Value("ClickDep","add")
OrgId=DataTable.Value("OrgId","add")
OrgName=DataTable.Value("OrgName","add")
OrgParid=DataTable.Value("OrgParid","add")
IfEnable=DataTable.Value("IfEnable","add")
Ifjc=DataTable.Value("Ifjc","add")
Resumer=DataTable.Value("Resumer","add")
Tel=DataTable.Value("Tel","add")
Memo=DataTable.Value("Memo","add")
IfBlank=DataTable.Value("IfBlank","add")
IfDrop=DataTable.Value("IfDrop","add")
ExpectedResults=DataTable.Value("ExpectedResults","add")
end for
我想把以上这段程序写成一个函数,DATATABLE的列名作为变量,取该列对应的值赋给该变量,并且这些变量值都要返回。
下面这段代码,我知道不对,但是要改成什么样?
Function InitDatatable(SheetName,CurrentRow,nColumn)
DataTable.GetSheet(SheetName).SetCurrentRow(CurrentRow)
For i=1 to nColumn
pName=DataTable.GetSheet(SheetName).GetParameter(i).Name
pName=DataTable.Value(pName,SheetName)
return pName
Next
End Function