- Subject: [slang-users] SLang_restart, SLang_load_file returning -1, how do I restart?
- From: Jeremy Cowgar <jc@xxxxxxxxxx>
- Date: Fri, 02 Jan 2004 13:51:12 -0500
I have an application that roughly does:
SLang_init_all();
do alot of other things, and when the user wants to run a script:
if(SLang_load_file(filename) == -1)
SLang_restart(1);
now, with the application not restarting, and a syntax error in
"filename"... the user corrects the syntax error, but when they run the
new script w/o restarting the application, SLang complains:
S-Lang Error: Syntax Error: called from line 0, file: myfile.sl
myfile.sl on the first line calls a function that my application made
available via SLadd_intrin_fun_table(). That made me think that
SLang_restart(1) cleared all functions that are added to the stack,
maybe even undone the SLang_init_all(), so, first try I changed my
script running code to:
if (SLang_load_file(filename) == -1) {
SLang_restart(1);
SLang_init_all();
SLang_intrin_fun_table(...);
}
but this produces errors in my log such as:
S-Lang Error: Undefined Name: An intrinsic symbol table may not be added
twice. []
Therefore, I thought, ok, it must not clear the init_all(), so I removed
it and only init'd my intrin_fun_table but recieved the exact same
error.
Now, restarting the application causes the script to run great. For
completness sake, the script in working condition is very simple:
my_print("Hello, World!");
Now, to break it and check the restarting process, I simply did this:
my_print("Hello, World!";
... did not put a closing brace ')'...
any ideas on how I can make this work correctly?
----
jeremy <jc@xxxxxxxxxx>
Q: What do you call a boomerang that doesn't come back?
A: A stick.
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2004 date index]
[2004 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]