Hello folks!
So i've been recently messing around again with Love2D, and I was wondering, what's the best way of viewing a table's content?
I this case, what i mean is, you have a table. You don't know how deep it goes, how many tables within it has, and the fields it contains (such as "x", or "name", for example). You'd obviously go with a debugger, but what's the best option?
One of the options would be using BabeLua and VS2015, but that doesn't work for me, and i'm not sure ZeroBrane can do this.
What do you recommend? Has anyone ever had such trouble to deal with?
Best way of viewing a table's contents? [SOLVED]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Best way of viewing a table's contents? [SOLVED]
Last edited by Sulunia on Wed Mar 15, 2017 3:33 am, edited 1 time in total.
https://github.com/Sulunia
-
- Party member
- Posts: 515
- Joined: Wed Oct 05, 2016 11:53 am
Re: Best way of viewing a table's contents?
I have found rxi's lovebird very useful in this regard. Not only can you just dig into tables as though they're folders in some file management software, it also has a functional lua interpreter so you can punch in changes to the console and have them take place in your love2d project on the spot. Furthermore, you access it through your web browser, which makes it very portable so anyone who you give the code to can use it, too.
Of course, I imagine if you have very big number of entries in your tables it will certainly become cumbersome to use, and thus lose some of its usefulness.
Of course, I imagine if you have very big number of entries in your tables it will certainly become cumbersome to use, and thus lose some of its usefulness.
Last edited by MrFariator on Wed Mar 15, 2017 2:35 pm, edited 1 time in total.
Re: Best way of viewing a table's contents?
That's actually pretty neat, just tested it out. Many thanks! It will definitely suffice for now.MrFariator wrote: ↑Wed Mar 15, 2017 12:41 am I have found rxi's lovebird very useful in this regard. Not only can you just dig into tables as though they're they're folders in some file management software, it also has a functional lua interpreter so you can punch in changes to the console and have them take place in your love2d project on the spot. Furthermore, you access it through your web browser, which makes it very portable so anyone who you give the code to can use it, too.
Of course, I imagine if you have very big number of entries in your tables it will certainly become cumbersome to use, and thus lose some of its usefulness.
https://github.com/Sulunia
-
- Party member
- Posts: 227
- Joined: Thu Jun 28, 2012 8:46 pm
Re: Best way of viewing a table's contents? [SOLVED]
ZeroBrane Studio can definitely do this: you can either view the values in the stack window (if it's in one of the local variables or an upvalue) or you can see it in the Watch window. Just set the expression to the table name and it will show you the values in the table. You can also expand the values and not only view them, but update them as well in any of the sub-tables.Sulunia wrote: ↑Tue Mar 14, 2017 11:14 pm So i've been recently messing around again with Love2D, and I was wondering, what's the best way of viewing a table's content?
I this case, what i mean is, you have a table. You don't know how deep it goes, how many tables within it has, and the fields it contains (such as "x", or "name", for example). You'd obviously go with a debugger, but what's the best option?
One of the options would be using BabeLua and VS2015, but that doesn't work for me, and i'm not sure ZeroBrane can do this.
What do you recommend? Has anyone ever had such trouble to deal with?
You can also use one the fields or even functions as expressions, but keep in mind that expressions are re-evaluated after each stop in the debugger (to make sure they are up-to-date).
Who is online
Users browsing this forum: No registered users and 7 guests