Loading...
Logo
Processing Forum
Hello,

i'm quite new to procesing, forgive me that. And the bad English.
i need to write a points File for Rhino, it should look like this:

"xcoord","ycoord","zcoord"

i tried something like this:

output.println(""" + String.valueOf (x) + "","" + String.valueOf (y) + "","" + String.valueOf (z) + "","")

but it cant read the double quotes as plain text.
any ideas are much appreciated!

Simon

Replies(9)

Try

output.println(" + String.valueOf (x) + "," + String.valueOf (y) + "," + String.valueOf (z) + ");

??
Oh, no... I see your problem... hmm... 
what does this return :

output.println(" + "String.valueOf (x)" + "," + "String.valueOf (y)" + "," + "String.valueOf (z)" + ");

??
Thanks for the answer :)
we tried that already, but we need for the point file the double quotation.
it should looks like this in the text file:

"0","-0.112007434012474","0.04807572607068605"
You need to escape the double quote with a backslash \:

output.println("\"" + String.valueOf (x) + "\",\"" + String.valueOf (y) + "\",\"" + String.valueOf (z) + "\"")
thanks for your answer,

we tried that too.

we keep getting an unexpected token error for "\""

??
Good to know. Bookmarked!
This is what I had tested in Processing:
Copy code
  1. println("\"");   // escaped version
  2. println('"');     // double quote in single quotes
Both yield the same output: a "

So something else must be wrong in your code.
thanks again,

we also tried with the single quotes '"', but then we get a Badly formed character constant.

i guess we will have to review our code then
and maybe come back with another solution

* works now :)