This function reverses the positions of the objects in the list.
object.Exchange aIndex1,
aIndex2
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISList interface |
|
aIndex1 |
In, Required | int |
The index of the object in the list |
aIndex2 |
In, Required | int |
The index of the object in the list |
Fill in the list with the user-selected patients and display the patients in the list before and after the change.
Dim aList
Dim aPatient
Dim aMessage
Dim aIndexof
Dim i
Set aList = Profile.CreateList
const aPatientCount = 2
for i = 0 to aPatientCount - 1
set aPatient = Profile.SelectPatient
aList.Add(aPatient)
next
aMessage = "The patients in the list before the change: " & aList.Count
for i = 0 to aList.Count - 1
set aPatient = aList.Item(i)
aIndexof = aList.IndexOf(aPatient)
aMessage = aMessage & vbNewLine & " - " & aPatient.SurnameFirstName & " (" &_
aIndexof & ")"
next
aList.Exchange 0, 1
aMessage = aMessage & vbNewLine & "The patients in the list after the change: "
for i = 0 to aList.Count - 1
set aPatient = aList.Item(i)
aIndexof = aList.IndexOf(aPatient)
aMessage = aMessage & vbNewLine & " - " & aPatient.SurnameFirstName & " (" &_
aIndexof & ")"
next
Profile.MsgBox(aMessage)