
PRO
rz90208
USA
Asked

Can someone tell me why I am getting this error? I must be going code blind or I found a bug. ARC version 2020.05.18.00
Error on line 4: Missing ) in Expression
$HumanSaid = "birds can fly"
$Sentence = $HumanSaid
$xCount = 0
repeatwhile(contains($Sentence, " "))
$xStrLength = Length($Sentence)
$xIndex1 = IndexOf($Sentence, " ")
$Sentence = SubString($Sentence,$xIndex1 + 1,($xStrLength - ($xIndex1 + 1)))
$xCount = $xCount + 1
endrepeatwhile
$xCount = $xCount + 1
$WordCount = $xCount
Related Hardware EZ-B v4
Related Control
Script
ASFAIK there is no error, it's an EZ-Script bug this code works:
Javascript version:
Thank you PTP, I am starting to use JavaScript. But when I can't find what I want to do it is so easy to fall back to EZ-Script. Have to start from scratch as most of my scripts just vanished when I installed ARC and I can't find any backups and I know I have made lots.
by the way what does ASFAIK mean?
AFAIK =As Far As I Know
ASFAIK = PTP's version of AFAIK (All rights reserved)
Thanks again PTP
Are you just trying to count the number of words? Use the split() function and get the array length
@ DJ, Yup that is what I am doing. Thank you DJ