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

Robert Patterson robert at robertgpatterson.com
Sat May 28 02:53:24 CEST 2022


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>
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
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220527/7b3498ea/attachment.html>


More information about the JWLua mailing list