I have the exact same code in another function and it works just fine.
In troubleshooting: If I ? $a immediatly after the $a=PartnerSelect() I get the expected string. If $a = "your choice" the else statement works just fine.
I also thought that it might be complaining about the use of an array on the If $b[2] = 1 line, but added a $c = $b[2] and then If $c = 1, but it still complained.
My assumption is that it is the Line before the one reported, (the if statement) that is really the problem, but not sure what I am doing wrong in writing it.
$B[x] is always a 0 or 1 and $ExVar is always 1 - 6
Code:
Function O($PU)
$ = Split($Name[$PU,3],"~")
;$N = $Name[$PU,0]
If $[2] = 1 Or $ExVar < 4
$a = PartnerSelect($PU)
If $a <> "your choice"
$b = Willing($a)
If $b[2] = 1 Or $ExVar < 4
$LabelG.text + @CRLF + $Name[$PU,0] +" Please share with " + $a + @CRLF
Pause()
EndIf
Else
$LabelG.text = $LabelG.text + @CRLF + $Name[$PU,0] +" Please share with " + $a + @CRLF
Pause()
EndIf
Else
;Fix the label to explain more
$LabelG.text = $LabelG.text + @CRLF + "Sorry you do not have a preference, your loss"
Pause()
EndIf
EndFunction