pass textScrollList to proc

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2013
pass textScrollList to proc

Hi everyone, I'm curious if I can pass a textScrollList name to a procedure, so i can populate multiple lists with the same proc


textScrollList -ams 1 -p someParent myListName;

global proc populateList($listname, string $listItems[])
{
     textScrollList -edit $listName;

     for($listItem in $listItems)
     {                    
          textScrollList -edit -append $listItem $listName;
     }
}
//trying to use something like this doesn't work
populateList("myListName", $arrayOfElemenets);


Thanks
 
  02 February 2013
I don't see why it shouldn't.

Though when you state "it doesn't work", that is a rather vague statement.
 
  02 February 2013

global proc populateList(string $listName, string $listItems[]) 
{ 
   textScrollList -edit $listName; 

   for($listItem in $listItems) 
   {
       textScrollList -edit -append $listItem $listName; 
   } 
}


strange, it works now, I guess it's because I forgot to add string to $listName in my proc declaration.
 
  02 February 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:32 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.