问题描述:Lotuscript中提供的Implode对整数数组进行处理的时候,报错提示“对象不匹配”。
解决办法:
Implode对字符串数组进行处理
Function ExtImplode(valueToImplode,Seperator As String) As String
'=== Returns the value of the list or array imploded into a single string using separator
'--- If not array or list then quit
If Not Isarray( valueToImplode ) And Not Islist( valueToImplode ) Then Exit Function
retVal = ""
'--- Loop through value to implode
Forall aVal In valueToImplode
If hitOne Then
'--- Append seperator and value to return value
retVal = retVal & Seperator & aVal
Else
'--- Set inital value of return value to first value
retVal = aVal
hitOne = True
End If
End Forall
ExtImplode = retVal
End Function
解决办法:
Implode对字符串数组进行处理
Function ExtImplode(valueToImplode,Seperator As String) As String
'=== Returns the value of the list or array imploded into a single string using separator
'--- If not array or list then quit
If Not Isarray( valueToImplode ) And Not Islist( valueToImplode ) Then Exit Function
retVal = ""
'--- Loop through value to implode
Forall aVal In valueToImplode
If hitOne Then
'--- Append seperator and value to return value
retVal = retVal & Seperator & aVal
Else
'--- Set inital value of return value to first value
retVal = aVal
hitOne = True
End If
End Forall
ExtImplode = retVal
End Function