Page 1 of 1

I can't set an Array inputs of script

Posted: 27 Mar 2013, 07:17
by allen hyoga
I create a string array for a script input and I set a value to the variable, which cause a syntax error.
For example, the input variable is called "Name",I initialize like

Code: Select all

Name = new string[2] {"A","B"};
which complied well.But when I operate the array variable,just like

Code: Select all

int len = Name.Length;
string name = Name[0];
it will pop syntax error that said a get method is lacked.
However I define a string array in script, it works well.

Code: Select all

string[] NameArray = new string[2]{"A"."B"};
int len = NameArray.Length;
string name = NameArray[0];
is it a bug ?

Re: I can't set an Array inputs of script

Posted: 31 Mar 2013, 12:27
by Robert
Hi,

Are you trying to change script input value inside your script ?
I'm not sure but it seems that scripts inputs values can only be changed accessing the script node input property.
When you create an input value in a script it is initialized with the value the input property is connected to.

Robert

Re: I can't set an Array inputs of script

Posted: 01 Apr 2013, 04:56
by allen hyoga
I'm sorry, I meant the script output, not the input. :P

so is it a bug ?

Re: I can't set an Array inputs of script

Posted: 17 Apr 2013, 15:24
by MartinT
Hi,
its not a bug.
Due to binding restrictions there's no read/write access to single elements of an output array.
Simply work with a local array and assign it to the output array when needed.

Best regards
Martin