OldBotBuilder
USA
Asked
— Edited
This script has run without errors.
ControlCommand("Answer array", ScriptStart)
#Get 1 0f 16 random phrases from the array Answers
$z = (GetRandomUnique(0,15))
$phrase = ($Answers[$z])
ControlCommand("Script Manager"' ScriptStart, Speak (phrase")
But, now with ARC - Version 2016.02.18.02 I get:
Error on line 4: Input string was not in a correct format.
The last release that this script ran correctly was the one downloaded on 02/02/201.
The ControlCommand is a little wrong looking at the code you posted. Is that a copy/paste or re-typed?
I ask because I don't see how that ControlCommand could ever have run without error.
@Rich,
I re-typed the code.
The ControlCommand lines were generated by the Cheat Sheet. The reported error has nothing to do with ControlCommand.
What do you think is wrong with the script?
Thank you.
This line is wrong in a couple of ways. I don't see how it could have ever passed the syntax check when you tried to save it, let alone actually run.
Also this line doesn't need parenthesis:
Seems to pass the syntax check either way, however.
Would you mind sharing your project?
There's a lot of unneeded brackets and random quotes in places. I'd like to see the names of your controls and such, to see where this is coming from if indeed it's generated by the cheat sheet.
@WBS00001,
You are correct. I miss typed the ControlCommand("Script Manager"' ScriptStart, Speak (phrase") line.
The script has:
Again, the reported error has to do with "Input string was not in a correct format" from the
line.
With this latest EZ - Builder release (2016.02.18.02) the Check Syntax button and my script do not work.
With release 2016.01.31.00 Both my script and the Check Syntax work.
With release, 2016.02.18.02 my script and Check Syntax do not work on my computer which is a Dell Latitude E6420 Lap Top running Windows 7 Professional.
@JR, My project is in the cloud as LESTER 02-19-16 No Camera.
Any help is very much appreciated.
This release will solve the issue: https://synthiam.com/Community/Questions/9086
I reviewed your project - neat stuff you're doing. However, i do recommend proper use of brackets. Everything appears to be in a bracket, and i mean everything
Brackets are only necessary for overriding order of math operations or parameters for functions.
@DJ,
How do you define the index to an array? Are they "parameters for functions"?
Is this the proper construct for an array?
Where did the smiley faces come from?
Wouldn't the proper way to set $phrase to the third element in the array be;
?
Yes - the second way is correct. Absolutely not the first way... There is an examples folder in ARC and quite a few of the examples are regarding how to use Arrays. ARC array is similar format as all programming languages, as such, and each have their own constructor...
Brackets are only used for the reasons stated above, to override math operations or for function parameters. Such as...
You do not use brackets for absolutely any other reason - specifically never used while declaring a string...