<div dir="ltr"><div>I created this script called "test_return_value.lua":</div><div><br></div><div>function plugindef()<br> finaleplugin.RequireDocument = false<br> finaleplugin.LoadLuaSocket = true<br> finaleplugin.IgnoreReturnValue = true<br>end<br><br>return 11, 12, 13</div><div><br></div><div><br></div><div>And I call it with this script:</div><div><br></div><div><br>local script_path = finenv.RunningLuaFolderPath() .. "test_return_value.lua"<br>local items = finenv.CreateLuaScriptItemsFromFilePath(script_path)<br>local success, errmsg, msgtype = finenv.ExecuteLuaScriptItem(items:GetItemAt(0))<br>if errmsg ~= null then print("type", msgtype, errmsg) end</div><div><br></div><div>It always returns: success==true, errmsg=="13", msgtype==0.</div><div><br></div><div>The bug here is that it should be returning errmsg=="11". I'm not sure why it isn't, and I need to research it.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 12, 2023 at 1:12 PM Jan Angermüller <<a href="mailto:jan@angermueller.com">jan@angermueller.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
Robert,<br>
<br>
thanks a lot for v0.66!<br>
<br>
I have been testing the compatibility with Perfect Layout and also
tried the new "return value" handling.<br>
It seems to me like there is still a problem. I tried it in
Fin27/Win10/RGP Lua v.66.<br>
<br>
I call the plug-in with:<br>
local success,d1,d2=finenv.ExecuteLuaScriptItem(script) <br>
<br>
When the plug-in ended without error, but with:<br>
return 11,12,13<br>
<br>
The script above gave these values:<br>
success=true<br>
d1=13<br>
d2=0<br>
<br>
I think this is correct. (However, I have not found it in the
documentation.)<br>
<b><br>
</b><b>BUT: </b>this only happened the very first time when I
called the script directly after starting Finale.<br>
When I run the ExecuteLuaScriptItem a second time, it always results
in:<br>
<br>
success=true<br>
d1="" --or at least it's an "empty nothing" when I print
it with tostring(d1). It's not nil.<br>
d2=0<br>
<br>
So after the first run I can't influence the return value anymore.<br>
Seems like the return value is permanently stored somewhere in RGP
Lua.<br>
<br>
When I restart Finale, it's the same behaviour: first time correct
value 13, after that "".<br>
<br>
Jan<br>
</div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>