[JW Lua] TS and KS as strings example

Jan Angermüller jan at angermueller.com
Fri Mar 27 17:36:02 CET 2015


measure is a pointer to an object (an FCMeasure taken from the 
collection FCMeasures).
If you do print(measure) you see the pointer.
Now you assign this pointer to lastmeasure. It points to the identical 
memory that measure uses.
Check this script:

local measure=finale.FCMeasure()
measure:Load(1)
local lastmeasure=measure
print(measure,lastmeasure)
print(measure:ClassName(),lastmeasure:ClassName())

Jan

Am 27.03.2015 um 17:24 schrieb Charles O. Lawrence:
> Anyone,
> In this code, why is it not necessary to declare lastmeasre as FCMeasure()?
>
> local allmeasures = finale.FCMeasures()
> allmeasures:LoadAll()
> print ("Measure Count",allmeasures.Count)
>
> local lastmeasure  --  = finale.FCMeasure  apparently it is not necessary to
> declare this as FCMeasure() local TSString = finale.FCString() local
> KSString = finale.FCString() for measure in each(allmeasures) do
>      if measure.ItemNo > 1 then
>          measure.TimeSignature:MakeString(TSString)
>          measure.KeySignature:MakeString(KSString)
>          print ("Current
> Measure",measure.ItemNo,"TS",TSString.LuaString,"KS",KSString.LuaString,"Las
> t Measure",lastmeasure.ItemNo)
>          if not measure.TimeSignature:IsIdentical(lastmeasure.TimeSignature)
> or not measure.KeySignature:IsIdentical(lastmeasure.KeySignature) then
>              lastmeasure.Barline = finale.BARLINE_DOUBLE
>              lastmeasure:Save()
>          end
>      end
>      lastmeasure = measure
> end
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>


-- 
Jan Angermüller
Jevenstedter Str. 80
22547 Hamburg
Tel. 040 - 28 94 84 82
www.angermueller.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150327/cd22bc2e/attachment.htm>


More information about the JWLua mailing list