[JW Lua] FCLuaIterator problem: no entries detected if EndMeasurePos==StartMeasurePos

Simon Leclerc simon at prodsl.ca
Sat May 28 13:59:42 CEST 2022


After testing it, I arrive to the same conclusion. I use FCLuaIterator() often. Just never had to specify a region of 0-0.

The behaviour is not the same with “in eachentry” which will see an entry positioned at zero in a region of 0-0.







¯\_(ツ)_/¯

Simon Leclerc
60, Mirabelle
Ste-Agathe-des-Monts, Québec
J8C 0W9
simon at prodsl.ca




> On May 27, 2022, at 20:53, Robert Patterson <robert at robertgpatterson.com> wrote:
> 
> I would be interested to hear from anyone else on this issue. I know someone said they were using FCLuaInterator. This would potentially be a breaking change.
> 
> On Fri, May 27, 2022 at 11:02 AM Jan Angermüller <jan at angermueller.com <mailto:jan at angermueller.com>> wrote:
> Robert,
> 
> I noticed a problem with FCLuaIterator, probably caused by a < instead of <= operator.
> 
> According to the documentation the ForEachEntry operator should work like the each operator on entries.
> 
> But: if you set the EndMeasurePos==StartMeasurePos (e.g. both 0 in the code below), then ForEachEntry won't detect entries on that measure position. The each operator also shows all entries from that measure position.
> I.e. you always have to set EndMeasurePos to at least  StartMeasurePos+1 to make ForEachEntry work for a single measure position.
> 
> Test code: (should show all entries with articulations in measure 1 staff 1 measure position 0)
> 
> function ArticulationCallback(e)
>     print(e.MeasurePos)
> end
> 
>     local region=finale.FCMusicRegion()
>     region.StartMeasure=1
>     region.EndMeasure=1
>     region.StartStaff=1
>     region.EndStaff=1
>     region.StartMeasurePos=0
>     region.EndMeasurePos=0 --- when it is set to 1, it will work. When it's set to 0, it won't show any entries.
>     local iterator = finale.FCLuaIterator()
>     iterator:AddEntryFilter(finale.LIEFILTER_ARTICULATIONFLAG, finale.LILOGIC_AND)
>     iterator:ForEachEntry(region,ArticulationCallback)     
> 
> Could you please fix this in the next update?
> Or - should we keep it like this for compatibility reasons - add a line to the documentation.
> 
> Jan
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu <mailto:JWLua at jwmusic.nu>
> http://jwmusic.nu/mailman/listinfo/jwlua_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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220528/243c7e79/attachment.html>


More information about the JWLua mailing list