ID:171297
 
var/alist[20]
alist[1] = 1

I can't figure out what's wrong with it or what the proper syntax is that it produces this error:

chateau.dm:106:error:alist:left-hand side must be an object variable

Thanks for your help in advance.
Gynax wrote:
var/alist[20]
alist[1] = 1

I can't figure out what's wrong with it or what the proper syntax is that it produces this error:

chateau.dm:106:error:alist:left-hand side must be an object variable

Thanks for your help in advance.

It works for me. Perhaps you need to put the line "alist[1] = 1" in a procedure or a verb. It's code that happens at runtime. If you want to define the contents of a list at compile time, try something like this:
var/list/alist = list(1, 2, 3, 4, 5)
In response to Jon88
Thanks, your explanation proved quite helpful.