Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

Script Help Please

Good Morning,

I have created two arrays. I am trying to speak the contents of the arrays with the SAY command. For Example:

code
SAY("This is" + $ARRAYONE[0] + "good work" + $ARRAYTWO[0])
/code

When I run the script I get the error message: Variable is in array: $ARRAYTWO[0]
Which makes me think that I am trying to add. Do I have the syntax correct?

AI Support Bot
Related Content
Synthiam
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
#2  
The array brackets are square.

DefineArray( variable, size, [default value] )
#3  
I also need to add, can you do any math functions with arrays? I get the same error message.
#4  
Try it this way...

Code:


$one=$ARRAYONE[0]
$two=$ARRAYTWO[0]

SAY("This is" + $one + "good work" + $two)
#5  
You should be able to do math functions assuming the array values are numeric that is....
#6  
That worked. Thank You, Still would like to know why it had to be converted to a "regular" looking string... @DJ

That particular way is going to really complicate what I am trying to do....
#7  
@Richard, yes the array values are numeric. When I do this:

Code:



$C = $ARRAYONE[1] / $ARRAYTWO[1]



I get the same syntax error as before stated: Variable is in an array: ARRAYTWO
#8  
Convert them to a regular string like I did in my above example and then do the math on them...
#9  
Ok, converting them to a "regular" string worked. Why?
#10  
Not sure dude... Maybe DJ can answer that... Although my way worked, maybe we are missing something simple and there is actually a better way to do this...
#11  
How do you trigger this thread so that he can see it and need to chime in on it?
United Kingdom
#12  
He will see it, he is like Santa, he sees everything:)