PDA

View Full Version : Cannot convert data of type string[] to type string


pigbelly
07-07-2003, 05:00 PM
when i try to put this:

$tempNameHolder = `listRelatives -p $word`;

in to this:
$parentName[$v] = $tempNameHolder;

Maya tells me that you:
Cannot convert data of type string[] to type string

so, how do I get it there .-))

/Tommie "stupid"

GDC
07-07-2003, 05:06 PM
listRelatives returns an array, although it may not look like it. It may be a single element array. So in order to do what your doing you need to do this:

$parentNames[$v]=$tempNameHolder[0];

--g

klod
07-07-2003, 05:11 PM
hi again :)


the error is that $tempNameHolder is declared as a string array.

try this:

string $tempNameHolder[] = `listRelatives -p $word`;
$parentName[$v] = $tempNameHolder[0];


a good way of coding in mel is to always declare your variables, so you won't have surprises about their type.

that should help :)

CGTalk Moderation
01-15-2006, 02:00 PM
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.