|
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
[ 本帖最后由 FLY000 于 2009-4-30 10:11 编辑 ] |
|