Call Function from external script file


#1

Hey,

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?

example:

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.


#2

Have a look at ‘include’ in the mxs help.


#3

fileIn works fine for me.
try include instead


#4

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.


#5

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.


#6

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.