CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-21-2013, 01:01 AM   #1
jgibz
Lord of the posts
 
jgibz's Avatar
portfolio
Jack Gibbons
USA
 
Join Date: Nov 2003
Posts: 787
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

Code:
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
 
Old 02-21-2013, 09:06 AM   #2
Nyro
Lurking
 
Nyro's Avatar
portfolio
A. D.
Vertex Slinger
Munich, Germany
 
Join Date: Dec 2006
Posts: 1,436
I don't see why it shouldn't.

Though when you state "it doesn't work", that is a rather vague statement.
 
Old 02-21-2013, 04:21 PM   #3
jgibz
Lord of the posts
 
jgibz's Avatar
portfolio
Jack Gibbons
USA
 
Join Date: Nov 2003
Posts: 787
Code:
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.
 
Old 02-21-2013, 04:21 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:06 AM.


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