ISIntStrings.Remove

Description

This function removes the pair 'int - string' from the list.

Syntax

object.Remove aIndex

Part Attribute Type Description
object Required
The object always implements the ISIntStrings interface
aIndex In, Required
int
The index of the pair 'int - string'

Example

Append incorrect records to the list and show its content before and after removing them.

sub Main
  Dim aHost
  Dim aList
  Dim aLayout 
  
  Set aHost = Profile.CreateCDOFormHost
  aLayout = 0
  
  Set aList = aHost.GetAccessionPatientTemplateList(0, aLayout)
  aList.Add "Some Invalid Form A", -1
  aList.Add "Some Invalid Form B", -2  

  ShowList aList, "Dirty Patient prefs"

  RemoveItemsWithIncorrectIds aList
  
  ShowList aList, "Cleared Patient prefs"
end sub

sub RemoveItemsWithIncorrectIds(aList)
  for i = aList.Count - 1 to 0 step -1
    if aList.Data(i) <= 0 then aList.Remove(i)  
  next
end sub

sub ShowList(aList, aCaption)
  Dim aText
  Dim i

  aText = aCaption & ":" & vbCrLf
  for i = 0 to aList.Count - 1
    aText = aText & aList.Item(i) & "(" & aList.Data(i) & ")" & vbCrLf
  next
  Profile.MessageBox aText
end sub
Note:

Version information

Added in v7.8.0