View Full Version : A rename object question

09 September 2009, 12:45 PM
Hi all,
I have a question,I made a function, but running it returns different results,I want to get help

fn Rename_tex thename =
IF $.material != undefined then
$ = thename as string
$.name = thename as string

Rename_tex 11
Rename_tex abc
Why "undefined"

09 September 2009, 01:44 PM
To Max, abc looks like a variable, but there's no variable called abc defined in your code. So when you say Rename_tex abc, mxs silently passes undefined to your function. Then, in your function, you convert the incoming parameter to string so you get "undefined".

Try Rename_tex "abc" instead.



09 September 2009, 12:52 AM
I understand, thanks DreaTawn

CGTalk Moderation
09 September 2009, 12:52 AM
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.