[JW Lua] FCString:CreateEnigmaStrings doesn't work on long unicode strings, but on short ones
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Wed Jul 8 19:08:11 CEST 2015
Jan,
In your script, replace this row:
print("String:",i.LuaString)
with this:
print("String length:", i:GetLength())
Do you get empty string lengths where i.LuaString seems to result in
empty strings?
Best regards,
Jari Williamsson
On 2015-07-08 18:30, Jan Angermüller wrote:
> Jari,
>
> you are right that using FCString() functions is preferred over Lua
> functions.
> But it's not the non-FCString() functions that are causing the problem
> in this case.
> It is (most probably) the CreateEnigmaStrings().
>
> I attached below the same script - this time with FCString()-functions only.
> It's the same result: i.LuaString is empty when three or more unicode
> characters are appended.
>
> Best regards,
> Jan
>
> function SplitEnigma(text)
> --Create enigma strings and print all non-enigma commands (i.e.
> all texts)
> print("String to split:",text.LuaString)
> local splittext=text:CreateEnigmaStrings(true)
> for i in each(splittext) do
> if not i:IsEnigmaCommand() then
> print("String:",i.LuaString)
> end
> end
> end
>
>
> local text=finale.FCString()
> text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"
> text:AppendCharacter(0xe050)
> SplitEnigma(text)
>
> text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"
> text:AppendCharacter(0xe050)
> text:AppendCharacter(0xe050)
> SplitEnigma(text)
>
> text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"
> text:AppendCharacter(0xe050)
> text:AppendCharacter(0xe050)
> text:AppendCharacter(0xe050)
> SplitEnigma(text)
>
> text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"
> text:AppendCharacter(0xe050)
> text:AppendCharacter(0xe050)
> text:AppendCharacter(0xe050)
> text:AppendCharacter(0xe050)
>
> SplitEnigma(text)
> text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"
> text:AppendCharacter(123)
> text:AppendCharacter(123)
> text:AppendCharacter(123)
> text:AppendCharacter(123)
> SplitEnigma(text)
>
> Running [Unnamed Script] ======>
> String to split: ^fontMus(Bravura,8192)^size(24)^nfx(0)
> String:
> String to split: ^fontMus(Bravura,8192)^size(24)^nfx(0)
> String:
> String to split: ^fontMus(Bravura,8192)^size(24)^nfx(0)
> String: -- Empty !
> String to split: ^fontMus(Bravura,8192)^size(24)^nfx(0)
> String: -- Empty !
> String to split: ^fontMus(Bravura,8192)^size(24)^nfx(0){{{{
> String: {{{{
> <======= [Unnamed Script] succeeded (Processing time: 0.000 s).
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
More information about the JWLua
mailing list