[JW Lua] ExecuteLuaScriptItem: returning an error message

Jan Angermüller jan at angermueller.com
Mon Dec 19 23:44:13 CET 2022


Thank you for your suggestions, Robert.
I hadn't tried yet, because I didn't know if a "real error" had any side 
effects.
I thought that a simple "return 0" (1, true, false, whatever) at the end 
of the program could handle this as in the old DOS/UNIX tools.

Jan


Am 19.12.2022 um 17:48 schrieb Robert Patterson:
> Another option would be simply to return the error message when 
> there's an error. Then you could distinguish between your error 
> messages and Lua runtime error messages. (Because the success boolean 
> would be true but there would also be a message.)

Am 19.12.2022 um 17:42 schrieb Robert Patterson:
> Have you tried using the error function to return your error?
> On Mon, Dec 19, 2022 at 9:50 AM Jan Angermüller <jan at angermueller.com> 
> wrote:
>
>     Robert et al,
>
>     finenv.ExecuteLuaScriptItem can return up to three values.
>
>     But how can I force a script to return a certain error?
>     I thought that a simpe "return false" or "return true" at the end
>     of the executed script could influence one of the three values.
>     But that didn't work. I always get the return values
>     "true","nil","nil".
>
>     It's more that I only want to return a true or false - there is no
>     real error.
>
>     Any ideas?
>
>     Tested with v0.65 on Windows/Finale 27.
>
>     Jan
>     _______________________________________________
>     JWLua mailing list
>     JWLua at jwmusic.nu
>     http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

-- 
Jan Angermüller
Orchideenstieg 13
22297 Hamburg
Tel. 040 - 28 94 84 82
Mobil 0173 - 99 33 904
www.elbsound.studio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20221219/200537e8/attachment.html>


More information about the JWLua mailing list