Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function 1

Status
Not open for further replies.

Baixinha

Programmer
Dec 27, 2000
122
0
0
BR
How can I create and call a function and after finish, how can I return to the script that call it?

Tks for all.
 
Something like this:

on MyFunctionName (myFirstParam,mySecondParam,etc..)
--code goes here
return MyReturnValue--this line is only neede if you want to return a value
end MyFunctionName


to call the function use:
MyFunctionName (myFirstParam,mySecondParam,etc..)
if there is no return value, or
MyVariable = MyFunctionName (myFirstParam,mySecondParam,etc..)
to set myVariable to the return value.

You will automatically return to the calling script.

Chris.
 
I did this, but where I must create the function (in a new behavior or in the same score script that call it???).
 
Create the function in either the script that calles it or in a movie script.
If you create the function in a movie script then you can call it from any script. If you write the function in a behaviour then it can only be called from within the same behaviour script.

Chris.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top