View Full Version : Call Function from external script file

02-29-2012, 03:16 PM

I'm afraid that I resorted to posting a question online! This is my last resort to finding an answer to my problem/question and I know that the expertise on here will enlighten my :banghead:

Is it possible to call a function from an external script file if so how?


Script file called ScriptFile1.ms contains:

fn function1 x y z =
print x
print y
print z

Script file called ScriptFile2.ms contains:

fileIn "ScriptFile1.ms"

fn function2 a b c =
print a
print b
print c
function1 9 8 7

function2 1 2 3

As you can see I would like to call function1 (located in ScriptFile1.ms) from function2 that's located in ScriptFile2.ms. After reading many posts online I thought that fileIn would work but nope.

Any help would be greatly appreciated.

02-29-2012, 03:25 PM
Have a look at 'include' in the mxs help.

02-29-2012, 03:28 PM
fileIn works fine for me.
try include instead

02-29-2012, 03:48 PM
Have a look at 'include' in the mxs help.

I have, that's the first place I look but it doesn't mention it any where or not at least all the pages I have read.

02-29-2012, 03:59 PM
I tried a very simple version, like the one in my question and it worked.
Ill try and figure out why it isn't working in my script.

Thanks for the reply's!

Much appreciated.

CGTalk Moderation
02-29-2012, 03:59 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.