Using @Unique Function In Lotusscript

Removes all multiple values from the array of the items with the same data
Dim TestArray(6)
Dim ResultArray
Dim Idx%
Dim SubS$

' All items of TestArray must be of the same type - String, Number, Date

' String test

TestArray(0) = "Paul"
TestArray(1) = "Peter"
TestArray(2) = "Paul"
TestArray(3) = "Georg"
TestArray(4) = "John"
TestArray(5) = "Paul"
TestArray(6) = "Peter"

' Date test

TestArray(0) = Cdat("10.7.2000")
TestArray(1) = Cdat("14.7.2000")
TestArray(2) = Cdat("1.1.2000")
TestArray(3) = Cdat("10.7.2000")
TestArray(4) = Cdat("4.7.2000")
TestArray(5) = Cdat("14.7.2000")
TestArray(6) = Cdat("1.1.2001")

' Number test

TestArray(0) = 1
TestArray(1) = 1.2
TestArray(2) = 2
TestArray(3) = 5
TestArray(4) = 1.2
TestArray(5) = 3
TestArray(6) = 2

SubS = ""
For Idx = Lbound(TestArray) To Ubound(TestArray)
Select Case Datatype(TestArray(Idx))
SubS = SubS & "@ReplaceSubstring(@Text(""" & Cstr(TestArray(Idx)) &
' If number is converted to xxx,yyy instead of xxx.yyy - done by system
local settings -> restore original
Case 7: ' V_DATE
SubS = SubS & "[" & Cstr(TestArray(Idx)) & "]"
Case 8: ' V_STRING
SubS = SubS & """" & Cstr(TestArray(Idx)) & """"
End Select
If idx < Ubound(TestArray) Then SubS = SubS & ":"

ResultArray = Evaluate("@Unique(@Text(" & SubS & "))")

This was first published in November 2000

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.