[Closed] include #quiet ?
Is there a way to use include() without it gumming up your listener window? Especially when you’re including 350 lines of code?
what does your code look like? or are you using the include <script> from the listener itself?
keep in mind that it only includes the code at the include <script>, it doesn’t evaluate it at that point.
I.e.
-- this is the file to include, say, "test.ms"
print "hello world"
-- file to execute
print "alpha"
include "test.ms"
print "alpha"
results in
"alpha"
"alpha"
print "Hello World"OK
"beta"
"beta"
printing the content of the included file to the listener
whereas
-- other file to execute
fn test = (
print "alpha"
include "test.ms"
print "alpha"
)
test()
results in the expected
"alpha"
"Hello World"
"beta"
"beta"
where the included file is not printed to the listener
I have about 20 functions that I’m sharing in a bunch of scripts right now.
So I’m doing something like:
Functions.ms:
fn printname =
(
return "My Name is Bob"
)
NamePrinter.ms
include "functions.ms"
var = printname()
But it dumps the entire contents of functions.ms into the listener… in black and white.
if you scope your include within the script it shouldn’t write them out… your including in a global scope…
(
include "functions.ms"
var = printname()
)
If you want them available at the global level, it would be best to put them into a structure and then have them evaluate at plugin time… put the .ms file in the plugin folder and they will always be available as global functions. Check out stuctures, they’re a great way to organize global functions.