<< Zet (Set) class in LotusScript | Home | notes.ini settings that affect iNotes >>

Small bug in LotusScript Vector class

The problem occurs when calling the RemoveAllElements() method since the Vector isn't reset correctly, though all elements are removed.

The method should be changed from:

Public Sub removeAllElements()
	Dim i As Integer
	For i = 0 To Me.size() - 1
		If Isobject(array(i)) Then
			Set array(i) = Nothing
		Else
			array(i) = ""
		End If
	Next i
End Sub
to:
Public Sub removeAllElements()
	Dim i As Integer
	For i = 0 To Me.size() - 1
		If Isobject(array(i)) Then
			Set array(i) = Nothing
		Else
			array(i) = ""
		End If
	Next i
	
	'reset vector
	elementLength = 0
	ensureCapacity(10)
End Sub

I also did a simple extension of the Vector class to create a Set (or "Zet" since "Set" is a reserved word in LotusScript).