lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Hi everyone, my name is Diego and i am a newbie trying to
learn LUA. the following are some questions because i couldnt
f¡nd information about it. could you help me pls ?

1) does LUA accept some kind of try/catch structures ? any example ?

2) will GC free this NIL assignments ?

t = {}
i = 10;
t[1] = "diego";
t[2] = "martin";

-- do something...

t = nil;
i = nil;
collectgarbage("collect")

3) is there a way to create an array of a structured type ? something like this

mytype = struct {
  s : string;
  i : int;
}

var myarray : mytype;

myarray[1].s = "diego";
myarray[1].i = 10;
myarray[2].s = "martin";
myarray[2].i = 2;


4) suppose this scenario: i run a LUA script inside a process.
the process receives a finish-application message.
does it exists any "terminated" flag to know this "terminating process"

i mean, how do i have to do to exit an infinit loop ?

while not(lua.terminating)
  -- do loop
end



thanks in advance,
diego





What can you do with the new Windows Live? Find out