Search found 400 matches

by SamuraiCrow
Fri Jan 15, 2021 9:21 pm
Forum: RapaGUI
Topic: Advanced RapaGUI techniques
Replies: 20
Views: 2769

Re: Advanced RapaGUI techniques

Update! I finally found the bug! I had changed self.contents to RawGet(self, contents) instead of RawGet(self, "contents") in its place. When using a string key with RawGet, the key string must be in quotes! That's a subtle bug that I looked past without even seeing the problem. The Groups class sh...
by SamuraiCrow
Fri Jan 15, 2021 7:23 pm
Forum: RapaGUI
Topic: Advanced RapaGUI techniques
Replies: 20
Views: 2769

Re: Advanced RapaGUI techniques

Debugging time! As I was adding the generateXML$() functionality to the program, I discovered that I'd forgotten in multiple places to put a colon in front of the generateXML$() method calls instead of a dot. Also, I found that some of the recursion wasn't working right at the window level. Ultimat...
by SamuraiCrow
Fri Jan 15, 2021 6:37 pm
Forum: Newbie questions
Topic: How to iterate correctly over a given table and peek specific values
Replies: 8
Views: 1153

Re: How to iterate correctly over a given table and peek specific values

Just to narrow it down, try switching from HaveItem() to RawGet(). If it's truly not there, RawGet() will return Nil. It may just be a weird bug in HaveItem().
by SamuraiCrow
Wed Jan 13, 2021 1:12 am
Forum: Newbie questions
Topic: How to iterate correctly over a given table and peek specific values
Replies: 8
Views: 1153

Re: How to iterate correctly over a given table and peek specific values

On second thought, I think I know what you're trying to do. OpenFile(1, "t:table.bin", #MODE_READ) newtable = ReadTable(1) CloseFile(1) Function p_iteratelist(table) If(HaveItem(table,"stations")) DebugPrint("Stations: "..counter) For i,v In IPairs(table.stations) If(i > 0) DebugPrint("i: "..i) ForE...
by SamuraiCrow
Tue Jan 12, 2021 5:51 pm
Forum: Newbie questions
Topic: How to iterate correctly over a given table and peek specific values
Replies: 8
Views: 1153

Re: How to iterate correctly over a given table and peek specific values

If you need all keys for a table regardless of order, try switching from IPairs to Pairs. I don't know if this solves your problem because I really don't see the problem nor any mention in your example of "columns".
by SamuraiCrow
Thu Jan 07, 2021 8:59 pm
Forum: RapaGUI
Topic: Advanced RapaGUI techniques
Replies: 20
Views: 2769

Re: Advanced RapaGUI techniques

a few days ago, I added the rectangle and button classes to RapaEdit. It took surprisingly little effort. When I made the rectangle class, all I had to do was change a copy of the group class to be a single item of type rectangle. Rectangle class has no editable fields so most of the editing methods...
by SamuraiCrow
Fri Jan 01, 2021 2:55 am
Forum: RapaGUI
Topic: Advanced RapaGUI techniques
Replies: 20
Views: 2769

Re: Advanced RapaGUI techniques

Before I get into the GenerateXML recursion, I realized I didn't finish my object-oriented polymorphism discussion before. If you look at the files in the Gadgets directory of the RapaEdit repository, you'll notice that all of them have equivalent functions with the same names in the namespace table...
by SamuraiCrow
Mon Dec 21, 2020 9:38 pm
Forum: General programming
Topic: Can I self = NIL somehow in OOP?
Replies: 8
Views: 1023

Re: Can I self = NIL somehow in OOP?

Correct! Now you're getting it!
by SamuraiCrow
Mon Dec 21, 2020 8:45 pm
Forum: General programming
Topic: Can I self = NIL somehow in OOP?
Replies: 8
Views: 1023

Re: Can I self = NIL somehow in OOP?

The real problem with your example code is that the "a" variable is global and never goes out of scope. In order to be fully nullified, all uses of the handle to the table need to be Nil, not just one of them. Variable handles are reference counted so if one is forced to Nil, that handle will go out...
by SamuraiCrow
Mon Dec 21, 2020 5:09 pm
Forum: General programming
Topic: Any way to have Function save its Args for later use?
Replies: 17
Views: 2158

Re: Any way to have Function save its Args for later use?

Your prt variable is global so you aren't actually passing a parameter. If you stuff your parameters in a global table instead of garbage collecting them, then it will work.