Alienhead
Newcomer
- Joined
- Mar 29, 2022
- Messages
- 5
- Reaction score
- 0
First let me say, the current job project I'm working with has forced me into using LUA, i'm a coder but of other languages. I would like to report that I fell in love with LUA but not the case. Actually I can't wait to get off this project.
In any other language I've used I have been able to create type lists, or classes if you will
An example.
Type car '-- simple class or data type.
field color
field year
end type
Now if I had 20 cars to put into this type I'd simply :
local var = New car
var.color = "yellow"
var.year = 2019
Then if i needed to insert another ....
local var = New car
var.color = "red"
var.year = 2021
and as many as I needed... I could then go through the list with a for next loop or whatever and get what I needed.
for local x = EachIn Car:list
lookitup = x.year '-- blah blah blah
next
Simple type lists, supported by nearly every language in the scene. But yet after a solid week I have yet to find a way to handle this simple routine in LUA.
Any help please? before i end up getting fired. lol.
In any other language I've used I have been able to create type lists, or classes if you will
An example.
Type car '-- simple class or data type.
field color
field year
end type
Now if I had 20 cars to put into this type I'd simply :
local var = New car
var.color = "yellow"
var.year = 2019
Then if i needed to insert another ....
local var = New car
var.color = "red"
var.year = 2021
and as many as I needed... I could then go through the list with a for next loop or whatever and get what I needed.
for local x = EachIn Car:list
lookitup = x.year '-- blah blah blah
next
Simple type lists, supported by nearly every language in the scene. But yet after a solid week I have yet to find a way to handle this simple routine in LUA.
Any help please? before i end up getting fired. lol.