ID:139185   May 15 2011, 5:34 am Code: ```locs+="Mountain peak:[xh],[xy],1" ``` and ```usr<<"[locs]" ``` Problem description: I know this is small problem, but I am going to run into it again in the future. When I output the locs list, it gets clustered up. I wanted to ask how to make every list variable have separate lines when list is sent?
 <-> May 15 2011, 6:19 am ```for(var/x in locs) usr<<"[x]" ``` =P
 <-> May 15 2011, 6:54 am In response to Last Strike Entertainment Nope, it doesn't work.
 <-> May 15 2011, 7:07 am In response to Martys1103 ...Lol? Provide a snippet of how you're using it. EDIT: Make sure locs is a -list- var/list/locs
 <-> May 15 2011, 11:26 am In response to Last Strike Entertainment Last Strike Entertainment wrote: EDIT: Make sure locs is a -list- var/list/locs And make sure that you've initialized the list, otherwise it's just a string and you're concatenating text to it.
 <-> May 16 2011, 2:46 am In response to DarkCampainger I will add more code so you could understand it better. I thought it would be simple to answer at first (like a simple text macro to force new line), but it seems it's more complex than I thought. ```var/list/locsvar/P=0mob Generate_world() var/highs = input("How many high points?") as num var/H for(H=highs, H>=1, H--) var/xh=rand(1,world.maxx) var/xy=rand(1,world.maxy) new/turf/high(locate(xh,xy,1),rand(10,20)) locs+="Mountain peak:[xh],[xy],1" P++ world<<"[P]\th mountain peak made at [xh],[xy],1" world<<"All mountains are made." verb locs() usr<<"[locs]" ```
 <-> May 16 2011, 2:50 am In response to Martys1103 Wait, so do you actually want a list? Or do you just want a text string with line-breaks in it? If the former, you need to initialize your list: ```var/list/locs = list() ``` And then to output its contents: ```for(var/A in locs) world<
 <-> May 16 2011, 5:54 am In response to DarkCampainger Thank you, it worked. I wanted the first one. I didn't think you can use list() that way, right now I'm searching DM guide to see if I missed something about list() in there. Also, is list() always needed if you make a list without any initial contents?
 <-> May 16 2011, 10:42 am In response to Martys1103 Martys1103 wrote: Thank you, it worked. I wanted the first one. I didn't think you can use list() that way, right now I'm searching DM guide to see if I missed something about list() in there. Also, is list() always needed if you make a list without any initial contents? Typecasting a variable as a list doesn't actually create a list, it still holds null until you give it a value. A list is actually an object; just like mobs, objs, images, datums, and so on. It needs to be initialized. This can be done with new, list(), or with square brackets [len]. The reference explains all three methods. I personally prefer list(), but I know a lot of people use the other two methods.