On running the macro code below, execution stops with str in line “If str[i] …” highlighted and the above error is displayed. Can anyone see what’s wrong?
System is Windows 10, LO version 6.1.1.2 (x64)
REM ***** BASIC *****
function CountChars(str, char)
dim count
count=0
for i=1 to len(str)
If str[i] = "|" Then
count++
endif
next
return count
End