of     1   

sroge445
#8216806Monday, May 04, 2009 10:00 PM GMT

I know how to do them in C++, and I'm wondering how to do it in lua?
SuperJasonDB
Top 100 Poster
#8216857Monday, May 04, 2009 10:01 PM GMT

"Scripting Helpers" Is the forum for you.
sroge445
#8216920Monday, May 04, 2009 10:02 PM GMT

No, it's not. This isn't really all that basic lua dude.
MrDoomBringer
Top 100 Poster
#8217609Monday, May 04, 2009 10:14 PM GMT

No pointers in Lua, if I remember correctly.
level140roblox
#8217654Monday, May 04, 2009 10:15 PM GMT

Correct, no lua pointers.
XlegoX
#8217797Monday, May 04, 2009 10:18 PM GMT

When you assign a varaible to a table value, then the value becomes a pointer to the table (well, realy a pointer to it's first element). Local a = {} local b = a b.Value = "Hello" print(a.Value) --> Hello
level140roblox
#8217860Monday, May 04, 2009 10:19 PM GMT

Oh, thats what he means by pointers?
Meelo
#8218037Monday, May 04, 2009 10:21 PM GMT

Well, that's just reference. I mean, you can't shift your pointers 1 int to the right.
XlegoX
#8218064Monday, May 04, 2009 10:22 PM GMT

Well, pointers just mean a varaible "points" to the value it has, so realy tables in Lua are pointers...
FoobyZeeky
#13174118Friday, August 21, 2009 3:12 PM GMT

@xleg a = "This is a string." B = a print(B) Is B not a pointer?
XlegoX
#13174927Friday, August 21, 2009 3:35 PM GMT

Yes, but you can't make use of it as a pointer, because as soon as you edit the string, Lua points the value at where it allocated that new edited string, rather than the old one.
3V4R
#13175259Friday, August 21, 2009 3:45 PM GMT

Old thread bumped? =S Least it wasn't spam =D
BlueTaslem
#13176315Friday, August 21, 2009 4:14 PM GMT

Basically, Pointers don't mean much in Lua, unless you are dealing with the 'Function' , 'Table' , or 'Connection' types, in which case they have members and data, but they have their own value otherwise.... a = {5,3,2} b = a --a's pointer, you can use b to access a because it has ram allocated specifically for a single one.. b[1] = 2 That works, because b changes a... But you really only use it usefully on tables.

    of     1