Beginning Scripting [Solved]

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
jby601
Newbie Member
Posts: 8
Joined: Tue Dec 13, 2011 10:27 pm

Beginning Scripting [Solved]

Post by jby601 » Thu May 21, 2020 7:25 pm

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!
Last edited by jby601 on Fri May 22, 2020 8:50 pm, edited 1 time in total.

CVH
Premier Member
Posts: 779
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Beginning Scripting

Post by CVH » Fri May 22, 2020 8:11 am

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
QCADpro 3.24.3.0 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

User avatar
andrew
Site Admin
Posts: 6922
Joined: Fri Mar 30, 2007 6:07 am

Re: Beginning Scripting

Post by andrew » Fri May 22, 2020 3:41 pm

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.

jby601
Newbie Member
Posts: 8
Joined: Tue Dec 13, 2011 10:27 pm

Re: Beginning Scripting [Solved]

Post by jby601 » Fri May 22, 2020 8:50 pm

Thank you, Andrew

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”