Evaluate function - Operation failes

Hi,
For this script, when i have under 800 documents in the list it works.
But, over 800 documents I have an “Operation failed” error. The error occured at the Evaluate function line.

Someone has an idea to resolve the problem ?
Thank you very much.
Bob.


'Merge fields into list that can be used for sorting using @Sort function

For i = 0 To coll.Count - 1
If Not strSort = “” Then strSort = strSort & “:”
strSort = strSort & “”“”
For n = LBound(fieldnames) To UBound(fieldnames) + 1
strSort = strSort & Left(arrSort(i,n) & Space(arrFieldValueLength(n)), arrFieldValueLength(n))
Next n
strSort = strSort & “”“”
Next i

’ —
’ — 2) Sort array
’ —
arrSort = Evaluate(“@Sort(” & strSort & “: " & directionSort &”)")

’ —
’ — 3) Use sorted array to sort collection
’ —
Set collSorted = coll.Parent.GetView(viewname).GetAllDocumentsByKey(fakesearchstring)

For i = 0 To Ubound (arrSort)
Set doc = db.GetDocumentByUNID(Right(arrSort(i), 32))
Call collSorted.AddDocument(doc)
Next i

’ —
’ — 4) Return collection
’ —
Set SortCollection = collSorted

Exit Function

Subject: Triplicate post

You asked the same question in the 8 and 8.5 forums and got responses.

Subject: +1

Date Topic Author
Link Notes://Notes2/8525728F0055708B/5049EE164C54799785256BFF00519260/019F7F835A3798C685257FC5004D79E7 1 Evaluate function too many documents Bob McVeetee
Link Notes://Notes2/8525728F0055708B/5049EE164C54799785256BFF00519260/270D36D12A18850E85257FC500619560 You’re probably hitting the 32k limit in the formula language. (Created by Carl Tyler on 06/01/2016)

Date Topic Author
Link Notes://Notes1/8525744900544E5F/5049EE164C54799785256BFF00519260/B8C0C57D950B7AAD85257FC5004DB206 2 Evaluate function too many documents Bob McVeetee
Link Notes://Notes1/8525744900544E5F/5049EE164C54799785256BFF00519260/AC9D1582E087DF7485257FC500509021 Length limitation ? (Created by Big Ben 0 on 06/01/2016)
Link Notes://Notes1/8525744900544E5F/5049EE164C54799785256BFF00519260/970DF209690B5A8F85257FC6004C4DBD Here’s a LotusScript shell sort, too (Created by Mike Woolsey on 06/02/2016)