- AuthorPosts
- December 14, 2008 at 10:36 pm #6751nickbMember
How can we insert the content of standard.jsee in action.jsee at a desired position? :-?
December 15, 2008 at 5:40 pm #6755Yutaka EmuraKeymasternickb wrote:
How can we insert the content of standard.jsee in action.jsee at a desired position? :-?You can use #include directive, but it must be specified at the first lines of the script above the main code.
December 16, 2008 at 12:04 am #6761nickbMemberThanks. I have tried ‘#include “standard.jsee”‘ and this includes the content of standard.jsee in the file that I’m changing with action.jsee
I added the include at the position where I need the content from action.jsee, so not in at the start of the file. This would run that file before the other lines.
I thought it could work as a php include. As this would be very usefull.
gr.
December 16, 2008 at 2:02 am #6765dreftymacParticipantYou can still do what you want if you make sure that standard.jsee encloses its code in a javascript function or a javascript class definition.
For example:
function say_hello(name){
return “hello world from ” + name + ” ! ” ;
}
// filename = say_hello.jsee#include “say_hello.jsee”
var name = ’emeditor’;
alert(say_hello(name));name = ’emacs??’;
alert(say_hello(name));name = ‘vim??’;
alert(say_hello(name));The #include feature of EmEditor is powerful enough to allow you to ‘insert’ code wherever you want as long as the code you are ‘inserting’ is correctly enclosed in a function or class, then you use the function or class to invoke the code you want to run at the exact place where you want to run it.
December 16, 2008 at 9:41 pm #6771nickbMemberThank you dreftymac for explaining and the example :-) gr.
- AuthorPosts
- You must be logged in to reply to this topic.