<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Jari,<br>
    <br>
    I sometimes get weird results in staff height calculations when
    changing staff distances through JW Lua:<br>
    <br>
    The score / staff distances looks fine on the screen after the
    change, but when I call FCStaffSystem:CalcHeight afterwards it
    returns wrong values, even negative staff system heights!<br>
    <br>
    Test script below and test score attached. The test score has a page
    height of 4761 EVPU and a staff system slightly smaller, so one
    would expect a staff height of approximately 4200 EVPU.<br>
    <b>But JW Lua calculates  -2156EVPU (minus!).</b><br>
    The score is a first page excerpt of a large orchestra score created
    in 2014.5. For file size reasons I attached in the Fin2012 format -
    the problem remains.<br>
    <br>
    I tested with JW Lua 0.49/Windows/2014.5, but the problem is older
    and also occured in 0.45.<br>
    <br>
    Best,<br>
    Jan<br>
    <br>
    local staffsystemslookup=finale.FCStaffSystemsLookup ()<br>
    local staffsystems = staffsystemslookup:GetCurrentPartStaffSystems
    ()<br>
    for s in each(staffsystems) do<br>
       
print(s:CalcHeight(false),s:CalcHeight(true),s.TopMargin,s.UseStaffResize,s.Resize,s.StaffHeight/64)<br>
    end<br>
  </body>
</html>