usr << i
var/text = copytext(t2l,i,i+1)
text1 += list(i=text)
return text1

Problem description:

I am trying to make a proc that turns an string into a list of individual letters. The code compiles perfectly fine, but when I try to view the list it gives me ONE single item on the list which is "i" instead of the individual numerical numbers. The variable I is changing perfectly fine, but for some reason when adding to the list it will not take the value of 'i' it takes the name of the var and puts it into the list (4 times in the example below.)

What the code should do:
1) Take the string
2) Make a list of each individual letter
3) Return that to the calling proc/verb.

What the list should be (when t2l = "Test")


What seems to be the actual result (when t2l = "Test")

Any help with my conundrum will be very appreciated (especially if a better way then "copytext" for this.)

(Also please not its been forever since I have programmed in byond, I've been working in java for a while so I'm pretty rusty at this. :P)
try using "[i]" when appending it to the list. it might make a difference since it's in text format instead of numerical format. I'm not sure on this though. I suck with lists.
An associative list won't work here as you are attempting to index with numerical values. Of course, this doesn't matter, because you are attempting to index with numerical values and so you can just use a normal list.

Just initialize the list using list() and add each letter one at a time.
In response to Garthor
Without an associative list, if there are two of the same letters it wont show up though only 1 of them shows :S
In response to Bravo1
Thankyou very much this actually worked XD

wonder why it doesnt work just as an integer though =/
In response to KingCold999
Lists are lists, not sets. They can contain duplicate entries.

Well, associative lists can't have duplicate keys, but you very much don't need one here.
In response to KingCold999
Because X[5] is defined to be the 5th element of a list. This supercedes associative indexing, and so if you attempt to use 5 as a key, X[5] will still just give you the fifth element of the list.