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

Jan Angermüller jan at angermueller.com
Fri May 27 18:00:45 CEST 2022


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220527/61bd0c2d/attachment.htm>


More information about the JWLua mailing list