Setattr -type Stringarray (2)

Hi

Here is my problem:

CODE
string $selectedNode[] = ls -sl;
string $someArray[] = { "string1", "string2", "string3" };
addAttr -ln "attrIsAnArray" -dataType stringArray $selectedNode[0]; // till there, no problem
setAttr ($selectedNode[0]+".attrIsAnArray") -type stringArray size $someArray $someArray;

gives:
CODE
// Error: Error reading data element number 5:  //

The problem is that I should have written
CODE
setAttr ($selectedNode[0]+".attrIsAnArray") -type stringArray size $someArray "string1" "string2" "string3";

But I won't know what will be in the array!

I tried: CODE
setAttr ($selectedNode[0]+".attrIsAnArray") -type stringArray size $someArray stringArrayToString($arrayOfAttributes," ");
but doesn't work. (Obviously since it returns a single argument!)

What is the way to do it?

Thanks

I got it work my putting the entire command in a string and used th eval command

CODE
string $cmd = "setAttr " + $selectedNode[0]+ ".attrIsAnArray -type stringArray " + size $someArray + " " + "\"" + stringArrayToString($someArray,"\" \"") + "\"";
eval($cmd);

Hope that helps,
-Brian
www.melJunky.com

Thanks