Product: Legasuite Windows Client (NOT THE WEB EDITOR)
I am having issues using the ScriptExec() function for creating user functions. I have been successful in using it to run scripts (script_type 0) and creating structures (script_type 1), but when using it to create User Defined Functions (script_type 2 according to the documentation) it crashes the client window when a call to the function is made. I have tried it both with loading the function from a file and running it directly from a variable. I have tried the most basic of functions and example functions from the documentation. All give the same result.
I am wondering why this crashes on functions but scripts and structures work without issue. I have looked through all of the documentation on the ini settings and did not find anything relating to user defined functions. Is there an undocumented ini setting or some flag that needs to be set to allow user defined functions?
Here is my test script using an example function from the scripting documentation:Dim i as integerDim s, f as stringf = "Function MyHelloWorldTest(i as integer) as string" + chr(13) + "MyHelloWorldTest = Str(i)" + chr(13) + "End function"ScriptExec(f,2) ' Run string f as function using option 2i = 42Messagebox("Show Function",f,4,0) ' Verifies program still running at this point and no errors in function definitions = MyHelloWorldTest(i) ' Program crashes as soon as the function is calledMessagebox("MyHelloWorldTest",s,4,0) ' Never runs because program crashes
------------------------------
Nick Dunevant
Charter Communications
------------------------------
