Manage Learn to apply best practices and optimize your operations.

Re: Extract Items In An Array

I just couldn't resist making an improvement on the last tip...

Here we use just one temporary array an make use of the possibility to traverse
the item values right from the item.values property. Saves som computing and
memory for the machine which can be useful if it is used a number of places.
Sub Extract(ID_Item As Notesitem, Value_To_Replace As String)
' One Temporary array to hold the return values
Dim Temp_Arr() As String

' It will not be larger than the current item
Redim Temp_Arr(Ubound(ID_Item.values)) As String
Count%=0
' Loop through the item values and save values that do not match the replace
value
Forall value In ID_Item.values
If value <> Value_To_Replace Then
Temp_Arr(Count%) = value
Count% = Count%+1
End If
End Forall

If Count%<>0 Then
' Redim the array to get rid of "white space" entries
Redim Preserve Temp_Arr(Count% - 1) As String
End If
ID_Item.values = Temp_Arr
End Sub

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close