CGTalk > Software > 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
Lord of the posts
jgibz's Avatar
Jack Gibbons
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

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);

Old 02-21-2013, 09:06 AM   #2
Nyro's Avatar
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
Lord of the posts
jgibz's Avatar
Jack Gibbons
Join Date: Nov 2003
Posts: 787
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
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
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
Society of Digital Artists

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

All times are GMT. The time now is 10:14 PM.

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