Page 1 of 1

Are neobook functions extracted during runtime?

PostPosted: Thu Mar 14, 2013 6:15 am
by Eduardo Volpi
Are neobook functions extracted to be used during runtime?
In case positive, where are they extracted to?


Eduardo Volpi

Re: Are neobook functions extracted during runtime?

PostPosted: Thu Mar 14, 2013 11:40 am
by dpayer
Eduardo Volpi wrote:Are neobook functions extracted to be used during runtime?
In case positive, where are they extracted to?
Eduardo Volpi


I have written several functions and I never see them 'extracted' in some sort of file format onto the hard drive.

It is my understanding that NB functions act as transportable subroutines. When you compile the pub file, the code is included. (The function code is not present in the .pub file itself which is simply text).

David P.

Re: Are neobook functions extracted during runtime?

PostPosted: Thu Mar 14, 2013 12:45 pm
by Eduardo Volpi
I could not see them extracted anywhere as well.

I had some really big subrotines for writing .rtf files (including images) which were slowing down my pub when openning it, both in Neobook and in runtime mode, then I transported all of them to functions and everything went fine again.

Now I´m just concerned about this functions beeing secure inside my program.

Re: Are neobook functions extracted during runtime?

PostPosted: Fri Mar 15, 2013 6:31 am
by Eduardo Volpi
Well, as far as I could verify, once you embed your functions, they are not extracted anywhere.

:)

Re: Are neobook functions extracted during runtime?

PostPosted: Fri Mar 15, 2013 9:34 am
by Neosoft Support
Functions are not extracted. They are loaded directly from the EXE into memory when needed.

Re: Are neobook functions extracted during runtime?

PostPosted: Fri Mar 15, 2013 11:33 am
by Eduardo Volpi
Ok. Thanks for the confirmation.

Re: Are neobook functions extracted during runtime?

PostPosted: Sat Mar 16, 2013 9:44 pm
by smokinbanger
Because I am always concerned about speed and resources this thread is very interesting. So if I followed correctly, an exe will load faster if very long scripts are placed in functions rather than subs. And a function isn't actually loaded into memory unless it is called for. So relying more on functions can, to an extent, give the best of both worlds. With that said, and speculating that if will take a moment to load, I'm curious how fast a long function can perform in comparison to a sub.

Re: Are neobook functions extracted during runtime?

PostPosted: Sat Mar 16, 2013 11:47 pm
by HPW
I do not think that there is much difference between funtions and subs as long we are talking about neoscript.
Both are embedded into the EXE and feeded into the neobook interpreter when called.
A different thing are javascript and vbscript, where other system resource are used.

Re: Are neobook functions extracted during runtime?

PostPosted: Sun Mar 17, 2013 8:30 am
by Eduardo Volpi
I had nearly 22 subrotines of more than 1200 lines each in my project. This was slowing down the pub both in Neobook and Runtime mode. I decided to transport each of this subs to Functions and everything went fine again, as fast as a new and fresh pub, so, as to My experience, relying more on functions you can obtain the best results.

However, the difference is noticeable on loading time only. Both (subs and functions) perform well and fast when executing.