LUA Tables with Lua Interface

Bozzy

Active member
Joined
Aug 31, 2007
Messages
27
Programming Experience
Beginner
Hi,

I've tried posting on the LUA Interface forums and noone has replied for AGES... So I thought I would post it here as its to do with VB 2008 as well.

I have a file:
VB.NET:
Test = "Hello"
TestInt = 6

Table = {}

Table['test'] = {
	data = 1,
	string = "Test"
}

And I want to get data from the variables.
I can already get data from the first two parts (Test + TestInt) because they are in the base section of the LUA file. The bit that confuses me is how to get values from LUA Tables using the LUA Interface 1.5.3

I have tried many things but I don't get how to do it...

Can somebody please help me with this, as I cannot carry on with my project unless this is sorted. However, I will completely understand if there are no replies etc as this is not the LUA Interface forums


Thanks,
Bozzy
 
You can read them as follows:
VB.NET:
Dim l As New LuaInterface.Lua
l.DoFile("some.lua")
Dim t As LuaInterface.LuaTable = l.GetTable("Table")("test")
For Each key As String In t.Keys
    MsgBox(t(key))
Next
Dim s As String = t("string").ToString
 
Back
Top