Page 1 of 1

Beginning Scripting [Solved]

Posted: Thu May 21, 2020 7:25 pm
by jby601
I really feel a noob asking this, but:

Looking at some of the example scripts, they usually begin with the line:

include("scripts/EAction.js")

If I type this into the Script Shell and press <enter>, the shell replies with:

[color=#0000FF]ecma>[/color] include("scripts/EAction.js")
undefined

If it won't accept even the first line I obviously am a real beginner. Help!

Re: Beginning Scripting

Posted: Fri May 22, 2020 8:11 am
by CVH
Odd, I know.
Try the scripts of this topic in the Shell.
viewtopic.php?f=2&t=6802&p=26202#p26201
They work, give the same 'undefined' here and there and even an error because of the wrong slash in the include.
I supose 'undefined' is the reply on the line entry.

Regards,
CVH

Re: Beginning Scripting

Posted: Fri May 22, 2020 3:41 pm
by andrew
The function include does not return anything. So that result of calling include is undefined. It's a JavaScript oddity but doesn't mean it didn't work.

Re: Beginning Scripting [Solved]

Posted: Fri May 22, 2020 8:50 pm
by jby601
Thank you, Andrew