0
我有一個按鈕,當您選擇一列時顯示行。但是我有一個問題,因爲它沒有獲得該領域的第二個價值。例如,我選擇列生日,但它有兩個具有相同值的項目(例如1990年1月1日),它只顯示字段中第一個項目的行,而沒有看到第二個項目。你可以幫我嗎?這裏是我的代碼:Lotusscript:沒有得到下一個數組索引
Sub Getvalue
Dim uidoc As NotesUIDocument
Dim ws As New NotesUIWorkspace
Dim printcolumn As String
Dim columnList() As String
Dim y As Integer
'-- print column --
For a = 0 To 10
setfield = "Untitled" & x
Set uidoc = ws.CurrentDocument
printfield = uidoc.FieldGetText(setfield)
Redim Preserve columnList(11)
columnList(a) = printfield
x = x + 10
Next
printcolumn = ws.Prompt(4,"Column List", "Select:", , columnList)
indexresult = (Arraygetindex(columnList, printcolumn)) + 1
'-- print row --
y = (indexresult*10) + 1
For b = 0 To 9
setrowfield = "Untitled" & y
Set uidoc = ws.CurrentDocument
printrowfield = uidoc.FieldGetText(setrowfield)
Redim Preserve rowList(10)
rowList(b) = printrowfield
y = y + 1
Next
printrow = ws.Prompt (4,"Row List", "", ,rowList)
'-- for duplicates --
Forall prow In columnList
If printcolumn = prow Then
indexresult2 = (Arraygetindex(columnList, prow)) + 1
z = (indexresult2*10) + 1
For b = 0 To 9
setrowfield = "Untitled" & z
Set uidoc = ws.CurrentDocument
printrowfield = uidoc.FieldGetText(setrowfield)
'Redim Preserve rowList(10)
rowList(b) = printrowfield
z = z + 1
'printrow = ws.Prompt(4,"Row List", "", ,rowList)
Next
printrow = ws.Prompt(4,"Row List", "", ,rowList)
End If
End Forall
End Sub
你真棒人。非常感謝! – drayl