what is the differents between
var/Players=list()
and
var/list/Players=list()
ID:271246
Mar 22 2007, 7:35 pm
|
|
var/Players is not typecasted, while var/list/Players is.
var/A=list() Only in rare cases should you not typecast it, such as when you don't know what the value is. In the case above you could then use the length() proc, or you could use the : operator. |
In response to Android Data
|
|
so which one contribute to the ERROR: maximum number of lists exceeded, casue i only want the lsit be called, when need instead on anything having a list
|
In response to Sayian Hunter
|
|
Pay attention. Both will create a list object, just one method typecasts the variable (typecasting affects compiling only, and is mainly for error checking) and one doesn't.
What creates a list object, is obviously the new() proc, or the shorthand list() proc, mostly used with the assignation operator ('=') to assign the list reference to the variable. //These lines are equivalent, typecast the var as a list, and create and assign a list object to the variable L: |
var/players=list()
sets the variable players to being in list form.
var/list/players=list()
creates a new list with the name, players.
Both have the same effect.