Output to scrollField in GUI

does anyone know why the values in an array will not output to a scrollField in a mel GUI?

If I use the print command on the array variable all of the stored values print to the script window fine, but if the variable is passed onto a scrollField command using -text $text, it only shows the first value of the array.

thanks

Geoff

I'm just trying to remember off the top of my head, but I recal that for each element in your array, you need to assign it to a new line in the scrollField. This is easily done with a loop.

thanks for the tip - I'm trying it out now, but without success - can't get the scrollfield to update - I'm getting the last iteration of the array to show instead of the first. If you've got time please have a look at my attempt and pick it to pieces:

this is the loop ($text is the array, $scrolltext is the variable I'm trying to feed into the scrollField)
string $scrolltext;
int $a;
for ($a = 0; $a < (size($text)); $a++)

{
$scrolltext = $text[$a];
}

and then fed into scrollField (i'm using formlayout so the scrollField is defined as a variable first before being attached to the form):

string $textfield = scrollField -text $scrolltext;

you need to either build up one string that you add to the scrollField with the -text flag or append to the text in thescrollField with the -it flag.

// build one long sting method...
string $scrollText;
for($a=0;$a < size($text);$a++)
{
$scrollText=($scrollText+$text[$a]+"n");
}
string $textfield=`scrollField -text $scrollText`;

OR
string $textfiled=scrollField myscrollfield;
for($a=0;$a < size($text);$a++)
{
scrollField -e -it $text[$a] myscrollfield;
}

I haven't really tested this, but it should at leaste get you going in the right direction.
--g

GDC - you are an utter Genius!!!!!!!! thankyou -I've been messing with this for a day without luck and you've fixed it for me in minutes - thanks.

your welcome.
Glad to hear it worked!
--g