Using @Unique Function In Lotusscript

This Content Component encountered an error
Removes all multiple values from the array of the items with the same data
type.
Dim TestArray(6)
Dim ResultArray
Dim Idx%
Dim SubS$

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

%REM
' String test

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

%REM
' 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")
%END REM

' 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))
Case 2, 3, 4, 5, 6: ' V_INTEGER, V_LONG, V_SINGLE, V_DOUBLE, V_CURRENCY
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 & ":"
Next

ResultArray = Evaluate("@Unique(@Text(" & SubS & "))")
This was first published in November 2000

Dig deeper on LotusScript

0 comments

Oldest 

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:

-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 ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close