See attached.
I've moved the 3 line function around, the line # already is the 'end' statement.
I've even added a 2nd parameter to the function in the off chance it meant the declaration; no go...
what am I missing?
Professional Software Development Tools
See attached.
I've moved the 3 line function around, the line # already is the 'end' statement.
I've even added a 2nd parameter to the function in the off chance it meant the declaration; no go...
what am I missing?
Try checking all your code, the code inside that function, inside that object, inside pages. Because in this case usually the errorlevel (luastack) isn't really nice and returns the wrong line and/or event
I have had this issue many times myself and later found that the error was somewhere else, in the function being called for example.
Thanks -- I've checked over all code, traced thru -- always the error is on "end".
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
Thanks -- 10minutes ago I would have taken you up on it.
I started commenting things out to narrow down the bare essentials (not easy when there's 10K lines of code...)
Boiled it down to: (not actual code)
On select of a list box:
4: Input.SetText("inpMyInput",MyFunc("Form1") );
Global functions:
1101: function MyFunc( cText )
1102: -- do some processing
1103: end
The error should be "OnSelect Listbox1 -> Line 4, Expected text in 2nd parameter, got nil"
but instead the error is "OnSelect combox1 -> line 1103, two parameters expected"
Code in the OnSelect of the combox triggers onselect of the listbox...
My oversight for not having that function return the value it calculated, but that error was pretty off the wall; even for IR error reporting!
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
Yeah some errorhandling needs some improval, and I know what you mean with
the 10k, my Object plugin currently as 90k code hehe. Yesterday when I added
the on the fly properties code, I had a bug somewhere and I couldn't find it...
the AMS runtime pointed me to an end keyword...
Anyhow, I'm glad you found the error![]()
when the error reporting is unreliable like that always check the indicated line number but in the global section, errors reported at a 'end' statement always come from a nested function call ..... this is why we need the debug lib!!!
yea, PX is at 57k lines and the editor is at 25k lines ...... bug track that bugger!!and I know what you mean with
the 10k
D.A.M thing takes 10 minutes to compile the 2.3 MB runtime, but its got more power than E-ON
lol, when i take a break from the project, i return and spend 2 weeks finding my way in the labyrinth of code .... haven't even looked at in months tho :(
Josh, it takes a little more time, but iv learned to check my argument values when working with big projects, a simple nil value in a nested function can take hours to track down, all depends on how far down in the stack the function call was
a simple check can save hours of searching
in future, if you come across this again, use 'pcall' on the function at the top of the stack, this way the error handler is direct from lua and bypass the AMS error handler, or if you want to handle the error yourself use 'xpcall'Code:if not cText then error("cText is nil",1) else -- your code here end
the above has saved my ass a few times in my PX project, im sure it also applies to AMS (if those functions are available in 5.0.2 ??)
Open your eyes to Narcissism, Don't let her destroy your life!!
You should use assert() instead of the if/then ERROR /else Your code/end simplier.... (just my $.02)
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
pcall with an function() and loadstring function returning a successboolean and the error (if any) will suffice I guess, lovely functions combined
Code:function _surpress_errors(luastring) local function eval(s) return loadstring(s)(); end return pcall(eval,luastring); end local bSuccess, szError = _surpress_errors("FuncDoesntExist();");
Dean, when you start picking up PX again, please let me know ^^ I've been putting of an encryption library to save it for PX, contains Whirlpool, sha1, sha256, xTea, xOr (several), AES Rijndael etc.
And ofcourse, for all the stuff you need me to do ^^![]()
I prefer
I guess because I'm used to it nowCode:if(type(var)~="table")then error("errormsg",2);end![]()
assert!!
my misses says i assert myself to much as it is
much better, thanksCode:assert(type(argument1) == "table", "Argument 1 must be of type table.");(im not rewriteing my code tho
)
Open your eyes to Narcissism, Don't let her destroy your life!!
You know, the IRLua Plugin Helper Functions can be applied to more than just plugins. For big projects that code is invaluable and makes error tracking a breeze.
Action Plugins
AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
Download
sure thing, iv no immediate plans tho, just waiting for them to make a day 48 hours, then maybe i'll have timeDean, when you start picking up PX again, please let me know
sure can, for big projects it would be worth while, not that many people realise the importance of proper error checking tho unfortunately, iv even had a driver installer from Foxconn that was made with AMS (for E-Bot) and it had a few nil value errors, very amateur!!, the E-Bot is now sat in the corner of the laundry closet...what a waist of money that was!!You know, the IRLua Plugin Helper Functions can be applied to more than just plugins
Open your eyes to Narcissism, Don't let her destroy your life!!
Sure, take it easy, code doesn't run awayOh god 48 hour days would be nice indeed haha
Even with perfect errorchecking errors can still emerge, so yes it's so importantBut in a case like this, a driver installer made with AMS, and you get nil value errors? XD Oh man, that's a funny failure
![]()