PtokaX forum

Development Section => HOW-TO's => Topic started by: andrea.vermetti on 25 May, 2005, 12:33:56

Title: a dynamic vector from c# to LUA
Post by: andrea.vermetti on 25 May, 2005, 12:33:56
Hi people... i'm form Italy and i new in this place.
Forgive my english...

Well i have great trouble....

In a C# class:

 i've got  a vector (of numbers)  of unknown lenght (it's variable), i can count  the records of this vector

so i have vector and vector.size

for example i want  result of the summatory of the values of the vector



i want to call a LUA FILE SCRIPT and give him in input the vector and the vector size and i want that  LUA gives me back the total like a FOR CICLE.

How can i give to LUA my two variables?????

I know how give LUA  variables in static way

this is my code

C#

Lua l=new Lua();

l["num"] = inputVal;
l["num1"] = inputVal1;


in LUA FILE

total = num+num1;

again in C#

int tot = (int) l("total");

************************

how can i do it in dynamic way


thanks  a lot

ANDREA


 




Title:
Post by: plop on 25 June, 2005, 21:25:44
bit late but just found this topic.
i think you can find the answer in the lua wiki on //www.lua.org, or ask in the dcdev hub.
as what i get from your question it has more 2 do with the lua api handling in c then the lua scripts we guy's/girls here on the board write.
2 take myself as an example i have 0 knowledge about c.

plop
Title:
Post by: kepp on 27 July, 2005, 16:58:38
I may be too late aswell..
Anyhow.. im not quite sure what you are on about..
You need to work on your english a little bit, lol