2019-07-14 19:03:01

I'm trying to write a program that will randomly generate a bunch of objects with coordinates, and that's done just fine.
But what confuses me is:

When I go to print it all to a file, I do this:

in the if statement that generates the randomness, I call generate();, witch generates the objects, minx, maxx, etc. Then I call ---------------------------
f.write(result);
Witch writes the result as shown in generate(), here is the result string at the end:
result=""+tile+":"+minx+":"+maxx+":"+miny+":"+maxy+":"+minz+":"+maxz+":tree
"+zone+":"+minx+":"+maxx+":"+miny+":"+maxy+":"+minz+":"+maxz+","+addz+","+zonetext+"
I want the tile and zone statements to be on seperate lines, but it puts an entire blank line between them, and then does another blank line after, witch seperates the next result from the first. 
I don't want this, because it makes my mapcode look even messier.

How would I fix this?

P.s. This is bgt if you couldn't tell.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-07-14 19:22:47

Don't make actual blank lines within the variable definition, but use the line break \n (or \r\n if on Windows) instead. E.g.:

alert("error", "This error will be on\nseparate lines, as you can see!");

2019-07-15 09:10:04

\r\n

Ivan M. Soto.
Feel free to check out my work and services.
http://ims-productions.com