We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › print() or println()
Page Index Toggle Pages: 1
print() or println() (Read 444 times)
print() or println()
Jul 24th, 2008, 4:51pm
 
I am looking at Processing Handbook, trying to copy one example, which doesn't seem to be working.

----------
String[] trees = { "ash", "oak" };
trees = append(trees, "maple");
print(trees);
----------
Console:
----------
[Ljava.lang.String;@b753f8
----------

It gives me this.
Is there something wrong with the code above?
When I changed print(trees) to println(trees),
it works. I'm using 0135.
I'd appreciate any help.

Re: print() or println()
Reply #1 - Jul 24th, 2008, 6:34pm
 
example must be slightly dated.

from: http://processing.org/reference/print_.html
"Beginning with release 0125, to print the contents of an array, use println(). There's no sensible way to do a print() of an array, because there are too many possibilities for how to separate the data (spaces, commas, etc). If you want to print an array as a single line, use join(). With join(), you can choose any delimiter you like and print() the result. "
Re: print() or println()
Reply #2 - Jul 24th, 2008, 6:42pm
 
Thank you.
Now, I can sleep..
Re: print() or println()
Reply #3 - Jul 27th, 2008, 1:23am
 
Yeah, sorry about that. It was a typo in the book, and we've fixed it for later printings:
http://dev.processing.org/bugs/show_bug.cgi?id=741
Page Index Toggle Pages: 1