[JW Lua] 'attempt to index' error
Charles O. Lawrence
charlesolawrence at bellsouth.net
Sat Nov 29 16:41:59 CET 2014
Bruce,
Just my 2 cents. I have not studied your code to see what you are actually
trying to do, but at first glance, it seems to me that you need to
define/initialize your local PageTextTable outside and before the scope of
the for loops and remove any local references on the PageTextTable within
blocks, such as if-then blocks. As it is now, you lose any definition of
PageTextTable once you leave the scope of the block.
local PageTextTable = {}
for pt in loadall(finale.FCPageTexts()) do
.
.
.
As I said, I'm not sure if this is what you intended, but then you can
PageTextTable[1] = PageTextLinks[1]
and not get the error.
Where is index [2] in all those scenarios?
Also if the intent is to copy one table to another with this statement later
on,
PageTextTable = PageTextLinks[k]
it won't work. Lua does not provide for a table copy, you have to program a
table copy with loops.
Someone better in Lua that me will have to jump in now. Good luck. Keep us
posted with your results.
-----Original Message-----
From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Bruce Olson
Sent: Saturday, November 29, 2014 4:54 AM
To: JWLua at jwmusic.nu
Subject: [JW Lua] 'attempt to index' error
Jari,
What is the reason for this error in the attached script?
[string "function plugindef()
..."]:333: attempt to index local 'PageTextTable' (a boolean value)
Thanks,
Bruce
--
Olson Sound Design, LLC
Bruce C. Olson
8717 Humboldt Avenue North
Brooklyn Park, MN 55444-1320
+1 (763) 493-5835 Office
+1 (763) 300-3893 Cell
Web Page: http://www.OlsonSound.com
Business: mailto:BCOlson at OlsonSound.com
Big Band: http://www.BRBB.org
More information about the JWLua
mailing list