Thanks Nick,
That gives me a better understanding of what you want to achieve.
The scripts that can be created in the windows client are actually stored as separate script files. In that way they are 'external' scripts to the windows client as they are not included in the package files (*.lwr, which holds the screen, panel, script and other files).
When I use the example script and implement this through the workbench in the package file, it does seem to work as expected.
But when it is used in a script executed from the windows client saved scripts/macro's it will not. This is what you are experiencing.
We have created a ticket to fix that in a future release.
As alternative you can use regular scripts instead of script functions. Global variables can be used as replacement for script function arguments.
This would allow you to do the things you need to do, just in a slightly different way.
For example using:
Global Param_i as integer
Dim s, f as string
f = "Global ResultValue as string" + chr(13) + "ResultValue = Str(Param_i)"
Param_i = 42
Messagebox("Show Function",f,4,0) ' Verifies program still running at this point and no errors in function definition
ScriptExec(f,0) ' Run string f as script using option 0
Messagebox("MyHelloWorldTest",ResultValue,4,0)
Hope this helps,
Regards,
Roger.
------------------------------
Roger van Valen
Rocket Software
------------------------------
Original Message:
Sent: 03-26-2021 09:10
From: Nick Dunevant
Subject: LEGASUITE WINDOWS CLIENT CRASHES WHEN USING SCRIPTEXEC() FOR FUNCTION SCRIPT TYPE
Sarah is correct, I am using the Windows Client version 7.6.2. I am aware it is an older version, but it is what my company requires us to use at this time.
ScriptExec() is being ran from a script within the Legasuite Windows Client "Open Script" menu. My intention is to have the function in an external script, load it into a variable via the FileLoad() function and use ScriptExec() to run it. I use this same process for scripts and structures which work perfectly. However, the example was run directly from the a built in script (nothing external) and still crashes the Client.
------------------------------
Nick Dunevant
Charter Communications
Original Message:
Sent: 03-26-2021 08:21
From: Sarah Gerards-Gilbert
Subject: LEGASUITE WINDOWS CLIENT CRASHES WHEN USING SCRIPTEXEC() FOR FUNCTION SCRIPT TYPE
If I recall correctly the version is currently 7.6.2.
However, the method for calling the ScriptExec, which Nick is using, is initiated through a macro (external script) on the Windows Client.
When testing, I find that the Client session terminates on script execution.
Roger and I are investigating this further.
------------------------------
Sarah Gerards-Gilbert
Rocket Software
Original Message:
Sent: 03-26-2021 07:54
From: Roger van Valen
Subject: LEGASUITE WINDOWS CLIENT CRASHES WHEN USING SCRIPTEXEC() FOR FUNCTION SCRIPT TYPE
Hi Nick,
What version are you using?
When I copy and paste your script into a test.script file, then execute this from a button (using an OIS object) then I get two message boxes.
The first one showing the script function, and the second showing the answer to everything: 42.
I have been using our latest GA version 8.5.5 for this test, using a windows client live test.
If you are on an older version you could try this in 8.5.5. If the problem persists in there it will be best to report this in a case through the customer portal so we can reproduce the problem here in the lab to fix this.
------------------------------
Roger van Valen
Rocket Software
Original Message:
Sent: 03-26-2021 07:38
From: Nick Dunevant
Subject: LEGASUITE WINDOWS CLIENT CRASHES WHEN USING SCRIPTEXEC() FOR FUNCTION SCRIPT TYPE
------------------------------
Nick Dunevant
Charter Communications
------------------------------