<div dir="ltr"><div>Okay, I suddenly realized that we are discussing a region where the end position is equal to the start position. (I guess I needed my morning coffee to realize this.) A selected region goes from the start position to (but not including) the end position. If start == end, then the region is empty. The bug here (if we want to call it that) is actually in the built-in functions eachentry and eachentrysaved which do not recognize that the region is empty. (Specifically it's the FCMusicRegion:IsEntryPosWithin function that should return false in this case.)<br></div><div><br></div><div>Think about it: the Finale UI does not allow selecting a region where start == end.</div><div><br></div><div>I am certainly not going to change eachentry or eachentrysaved. And I am disinclined to change FCLuaIterator, so perhaps I'll add a clarifying comment.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 28, 2022 at 7:01 AM Simon Leclerc <<a href="mailto:simon@prodsl.ca">simon@prodsl.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">After testing it, I arrive to the same conclusion. I use FCLuaIterator() often. Just never had to specify a region of 0-0.<div><br></div><div>The behaviour is not the same with “in eachentry” which will see an entry positioned at zero in a region of 0-0.</div><div><br></div><div><br><div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-variant-caps:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;line-height:normal;border-collapse:separate;border-spacing:0px"><div style="overflow-wrap: break-word;"><div><div><span style="font-style:normal"><br><br></span></div><div><span style="font-style:normal"><br></span></div><div><span style="font-style:normal"><br></span></div><div><span style="font-style:normal"><br></span></div><div style="font-family:Helvetica;font-style:normal;font-weight:normal;font-size:12px"><span style="font-family:"Times New Roman",serif;font-size:16px">¯\_(</span><span style="font-family:"MS Gothic";font-size:16px">ツ</span><span style="font-family:"Times New Roman",serif;font-size:16px">)_/¯</span></div><div style="font-family:Helvetica;font-style:normal;font-weight:normal;font-size:12px"><span style="font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;line-height:normal;border-collapse:separate;border-spacing:0px"><div style="overflow-wrap: break-word;"><div><br></div><div>Simon Leclerc</div><div>60, Mirabelle</div><div>Ste-Agathe-des-Monts, Québec</div><div>J8C 0W9</div><div><a href="mailto:simon@prodsl.ca" target="_blank">simon@prodsl.ca</a></div></div></span></div></div><div style="font-family:Helvetica;font-style:normal;font-weight:normal;font-size:12px"><br></div></div></span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;line-height:normal"><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"></div>
</div>
<div><br><blockquote type="cite"><div>On May 27, 2022, at 20:53, Robert Patterson <<a href="mailto:robert@robertgpatterson.com" target="_blank">robert@robertgpatterson.com</a>> wrote:</div><br><div><div dir="ltr">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.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 27, 2022 at 11:02 AM Jan Angermüller <<a href="mailto:jan@angermueller.com" target="_blank">jan@angermueller.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  

    
  
  <div>
    Robert,<br>
    <br>
    I noticed a problem with FCLuaIterator, probably caused by a <
    instead of <= operator.<br>
    <br>
    According to the documentation the ForEachEntry operator should work
    like the each operator on entries.<br>
    <br>
    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.<br>
    I.e. you always have to set EndMeasurePos to at least 
    StartMeasurePos+1 to make ForEachEntry work for a single measure
    position.<br>
    <br>
    Test code: (should show all entries with articulations in measure 1
    staff 1 measure position 0)<br>
    <br>
    function ArticulationCallback(e)<br>
        print(e.MeasurePos)<br>
    end<br>
    <br>
        local region=finale.FCMusicRegion()<br>
        region.StartMeasure=1<br>
        region.EndMeasure=1<br>
        region.StartStaff=1<br>
        region.EndStaff=1<br>
        region.StartMeasurePos=0<br>
        region.EndMeasurePos=0 --- when it is set to 1, it will work.
    When it's set to 0, it won't show any entries.<br>
        local iterator = finale.FCLuaIterator()<br>
        iterator:AddEntryFilter(finale.LIEFILTER_ARTICULATIONFLAG,
    finale.LILOGIC_AND)<br>
        iterator:ForEachEntry(region,ArticulationCallback)     <br>
    <br>
    Could you please fix this in the next update?<br>
    Or - should we keep it like this for compatibility reasons - add a
    line to the documentation.<br>
    <br>
    Jan<br>
  </div>

_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>
_______________________________________________<br>JWLua mailing list<br><a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br><a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>