ID:266727
 
For lists do you need to make it like this
var/list/visit=list()
or can it be
var/visit=visit()
Strange Kidd wrote:
For lists do you need to make it like this
var/list/visit=list()
or can it be
var/visit=visit()

visit() isn't a proc, so that won't work. They'd both have to be =list(). These syntaxes will all work:
var/visit=list()
var/visit[5]
var/list/visit=list()
var/list/visit=new
var/visit=new /list

Lummox JR
In response to Lummox JR
var/visit[5]

That would produce a different result than the others, though.

What you'd be looking for would be var/visit[0] to mimic the same effect of creating an empty list.

(visit[5] would be filled with five null entries.)
In response to Lummox JR
> var/visit[5]
> var/visit=new /list


Note that if you don't specify that var/visit is a list, the compiler won't like you for trying to perform list functions on it.