It's also NOT documented on the reference, well now it should. What i mean is you can do this:
mob/verb/Test() {
world << src.ListReturn()[1];
}
mob/proc/ListReturn() {
var/list/MyList = new;
MyList += "Ocean King";
MyList += "woo!";
return MyList;
}
mob/verb/Test() {
for(var/Element in src.ListReturn()) {
world << Element;
}
}
mob/proc/ListReturn() {
var/list/MyList = new;
MyList += "Ocean King";
MyList += "This is second element on the list.";
MyList += "This is third element on the list.";
return MyList;
}
mob/verb/Test() {
var/list/ReturnedList = src.ListReturn();
world << ReturnedList[1][1]
world << ReturnedList[1][2]
world << ReturnedList[2][1]
world << ReturnedList[2][2]
}
mob/proc/ListReturn() {
var/list/MyList[2][2];
MyList[1][1] = "Ocean";
MyList[1][2] = "King";
MyList[2][1] = "Second";
MyList[2][2] = "Element";
return MyList;
}
mob
var
MyProc = /proc/ListReturn;
mob/verb/Test() {
world << call(MyProc)()[1];
}
/proc/ListReturn() {
var/list/MyList[1];
MyList[1] = "Ocean King";
return MyList;
}
Yes, you're able to do 'world << src.ListReturn()[1];' Since you're returning the list in the procedure it wll let you to access the list element.
Shouldn't this be added to the reference?
As an added bonus, I like to initialize my lists like this:
var mylist[0]