issue with functions inside of a class
I recently ran across an issue where when I am defining functions inside of a class I can no longer use the "self" identifier such as:
Code:
10 MyWindow = class( Turbine.UI.Window ) Any idea what it is that I am missing? This really has me lost tonight... |
When you call the BronkenFunction(), are you using . or :? I.e.,
myWindow = MyWindow(); myWindow.BronkenFunction(); vs. myWindow = MyWindow(); myWindow:BronkenFunction(); Because you should be doing the second. |
Okay, that worked, and explains why it was so flacky and only did it when I clicked one button (all the other ways it was called worked fine). Guess I was more tired then I thought last night.
Thank you. |
Quote:
Code:
MyWindow.BronkenFunction = function() |
And this example would fail again, because there would be no "self" (or at least no valid self).
Code:
function Table:Foo( arg ) Code:
Table.Foo = function( self, arg ) Code:
Table:Foo( 1 ); Code:
Table.Foo( Table, 1 ); |
What I read....
If the inverting-core acceptor deflects the complex chronotron-feedback analysis, try to provoke a coil-composition reflex and several quantum biosphere resonances, this will create a restricted isovolumic cochrane graviton-prediction, which ought to in fact dampen the polarizing maintenance-filament formulas. Then attempt a minimum abstract component-delay correction phase to input a reversible lucifugal primary ionization perimeter operation to cancel the celestial info-sphere greenhouse effect level-limits. As you are doing this, set in motion six homeostasis global-attractors from the constant chemical cybernetic-induction elliptical-beam, this will dislodge a krypton placebo-molecule from the kinetic synthesis-accelerator.
You guys are talking greek. LOL |
LOL not that bad bonechip ;)
Still seams funny to me that LUA has such a flexable syntax, I am usto very defined lines instead of the the whole "you can do it this way, or if you want this way, or this way... " and the fact that it all still works unless you make a dumb mistake is just Icing on the cake. |
Quote:
Code:
self.BronkenFunction = function() |
Quote:
|
Quote:
Code:
MyWindow = class( Turbine.UI.Window ) |
All times are GMT -5. The time now is 04:42 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI