Есть много возможностей, некоторые даже не нуждаются в LotusScript-L oop:
Первый: уже выполните объединение в формуле:
Dim strResult as String
varAttachmentNames = Evaluate( {@Implode( @AttachmentNames , "##")} , doc )
strResult = varAttachmentNames(0)
Второй: используйте @ Implode-аналог в LotusScript:
Dim strResult as String
varAttachmentNames = Evaluate( "@AttachmentNames" , doc )
strResult = Implode( varAttachmentNames, "##" )
' or with the (in other programming languages) more common alias "Join":
'strResult = Join( varAttachmentNames, "##" )
Третье: используйте свой Forall-L oop:
Dim strResult as String
varAttachmentNames = Evaluate( "@AttachmentNames" , doc )
Forall strAttachmentName in varAttachmentNames
Set object = doc.GetAttachment( strAttachmentName )
fileName = object.Name
If strResult = "" then
strResult = fileName
Else
strResult = strResult & "##" & fileName
End If
End Forall