[JW Lua] CreateTextString with "empty" text expressions can now cause problems (v052) - worked fine in v049
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Tue Aug 15 21:45:55 CEST 2017
Jan,
I'll change this back in the next beta, to the "empty string" approach.
That should make it consistent with how raw text works in text blocks.
Best regards,
Jari Williamsson
On 2017-08-15 14:04, Jan Angermüller wrote:
> Jari,
>
> in v0.52 I now have a problem with "empty" text expressions (see
> expression 1 in the attached file).
>
> Code snippet:
> local exprdefs = finale.FCTextExpressionDefs()
> exprdefs:LoadAll()
> for exprdef in each(exprdefs) do
> local text=exprdef:CreateTextString()
> print(text.LuaString)
> end
>
> In v0.49 it simply printed an empty line:
> Running [Unnamed Script] ======>
>
> <======= [Unnamed Script] succeeded (Processing time: 0.001 s).
>
> In v0.52 it now returns an error message:
> Running [Unnamed Script] ======>
> [string "local exprdefs = finale.FCTextExpressionDefs(..."]:5: attempt
> to index local 'text' (a nil value)
> <======= [Unnamed Script] FAILED.
>
> (I didn't check v0.50 and v0.51)
>
> Of course, I could develop very defensive here and add an "if
> (text~=nil) then" in this case, but I thought this would be a scenario
> that should always return a valid value - as it did until v.49.
> What do you think about it?
>
> Best,
> Jan
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
More information about the JWLua
mailing list