[JW Lua] Iterator for FCNumbers or how to a create a simple loop ?
Jan Angermüller
jan at angermueller.com
Wed Dec 2 15:36:32 CET 2015
Jari,
could you please add a "standard" loop to the FCLuaIterator class, so
that for example a simple loop from 1..1000 could also update the
progress bar ? Not all iterations can be broken down to the available
Finale elements, although most of them are covered by your supported
classes.
I thought of the FCNumbers class being filled with values from 1 to 1000
which is then passed to the iterator. Something like:
function callback(i)
... -- do a lot of processinng
print(i.Int)
... -- do a lot of processinng
end
--Simple loop with FCNumbers
local loop=finale.FCNumbers()
for i =1,1000,1 do
loop:AddUniqueInt(i)
end
local iterator=finale.FCLuaIterator()
iterator.ForEach(loop,callback)
While writing this, maybe it would also be a good idea to add a new
method to FCNumbers that would would create a range as above. This would
reduce the code to:
local loop=finale.FCNumbers()
loop:AddRange(1,1000) -- would do the same as the i-loop above
local iterator=finale.FCLuaIterator()
iterator.ForEach(loop,callback)
Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20151202/c03f1cc7/attachment.htm>
More information about the JWLua
mailing list