I can't set an Array inputs of script

Please report bugs in this group. We will maybe populate a list of known bugs with a possibly modified description at a later time.

I can't set an Array inputs of script

Postby allen hyoga » 27 Mar 2013, 07:17

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 ?
User avatar
allen hyoga
 
Posts: 91
Joined: 01 Feb 2012, 10:00
Location: HK,China

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

Postby Robert » 31 Mar 2013, 12:27

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
User avatar
Robert
 
Posts: 265
Joined: 21 Jan 2012, 09:25
Location: Toulouse - France

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

Postby allen hyoga » 01 Apr 2013, 04:56

I'm sorry, I meant the script output, not the input. :P

so is it a bug ?
User avatar
allen hyoga
 
Posts: 91
Joined: 01 Feb 2012, 10:00
Location: HK,China

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

Postby MartinT » 17 Apr 2013, 15:24

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
MartinT
 
Posts: 7
Joined: 01 Aug 2012, 16:15


Return to Bug Reports

cron