[JW Lua] TS and KS as strings example
Charles O. Lawrence
charlesolawrence at bellsouth.net
Fri Mar 27 18:38:51 CET 2015
Thanks Jan. Your reply had been pushed way down in my inbox, so I just now
saw it. Makes good sense.
Charles
From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Jan Angermüller
Sent: Friday, March 27, 2015 12:36 PM
To: The JW Lua script plug-in.
Subject: Re: [JW Lua] TS and KS as strings example
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 <mailto: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 <http://www.angermueller.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150327/38d129d4/attachment.htm>
More information about the JWLua
mailing list