Again I cannot see what I am doing wrong.
Is this another bug or am I using the array incorrectly?
$SearchString = "aaaa"
$TestArray = "<aaaa><bbbb><cccc>"
if($SearchString = SubString($TestArray,1,4))
if($SearchString = SubString($TestArray,1,IndexOf($TestArray,"><")))
Upgrade to ARC Pro
Your robot can be more than a simple automated machine with the power of ARC Pro!
***Edit*** never mind you fixed it...
I tried to simplify the expression, and didn't remove the extra closing bracket.
But when I did simplify it, it did work.
EZ-Script is good for simple scripts, and i believe it was developed for simple statements.
there are no expression trees or byte code translation the script lines/statements are evaluated on the fly using a text parser and the things can get complicated with nested conditions, multiples arguments, operators etc.
with that in mind you have some options:
1) Simplify the expressions like using variables, remember everything is evaluated on the fly so replace multiple function calls assigning the function result to a variable and reusing the variable to check the result.
2) Avoid nested expressions
3) Avoid complex scripts when possible
1) Learn c# and create a plugin
Is not fast as c# code but it's well known, and if you find a language/parser issue you can open a ticket.
I did just that and simplified the script using variables.
It is not easy to build even a simple brain and not write complex scripts.
Thanks again for your reply.
And so does this, by adding spaces (for some reason) with proper code formatting
To help troubleshoot:
EDIT: I've changed the code with several combinations, a space before the IndexOf does the trick
Thank you also ptp