It seems like in most mainstream programming languages, returning multiple values from a function is an extremely awkward thing.
The typical soluti
c#
public struct tStruct
{
int x;
int y;
string text;
public tStruct(int nx, int ny, string stext)
{
this.x = nx;
this.y = ny;
this.text = stext;
}
}
public tStruct YourFunction()
{
return new tStruct(50, 100, "hello world");
}
public void YourPrintFunction(string sMessage)
{
Console.WriteLine(sMessage);
}
in Lua you call
MyVar = YourFunction();
YourPrintfFunction(MyVar.x);
YourPrintfFunction(MyVar.y);
YourPrintfFunction(MyVar.text);
Output: 50 100 hello world
Paul