|
Author |
Topic: text() and println() (Read 328 times) |
|
benelek
|
text() and println()
« on: Jun 18th, 2003, 2:51pm » |
|
as usual, feel free to tell me this isn't a bug. when i try the following code, the letter 'f' is printed on screen, while the number '102' is printed in the prompt... shouldn't println() and text() display the same thing? Code://lines[] is an array of String values. char a=char(int(lines[15].charAt(2))); text(a,30,50); println(a); |
|
|
|
|
|
arielm
|
Re: text() and println()
« Reply #1 on: Jun 18th, 2003, 4:30pm » |
|
i don't see any bug here... it's just the assumption that println() and text() should display the same thing that seems uncorrect to me: i think println() is simply much smarter, it can take variant types (String, float, etc.) as input, while text() can only accept String or char...
|
Ariel Malka | www.chronotext.org
|
|
|
fry
|
Re: text() and println()
« Reply #2 on: Jun 18th, 2003, 5:12pm » |
|
whups, that actually is a bug.. we didn't have a version of print() and println() for char, so instead it was turning the char into an int when it printed to the console. i've just made the fix so it'll be available in rev 56 (available in the next week, hopefully). as always, thanks for the note.. good find..
|
|
|
|
arielm
|
Re: text() and println()
« Reply #3 on: Jun 18th, 2003, 9:14pm » |
|
oops! next time i'll be more careful with "assumptions"...
|
Ariel Malka | www.chronotext.org
|
|
|
benelek
|
Re: text() and println()
« Reply #4 on: Jun 19th, 2003, 12:29am » |
|
lol, dont worry bout it arielm as a matter of curiosity, suppose i had a char, and i wanted to output with text() its numeric value, how would i do it? the old reference section used to have something on this i think, but i can't find it anymore...
|
|
|
|
arielm
|
Re: text() and println()
« Reply #5 on: Jun 19th, 2003, 1:24am » |
|
i would make a new assumption stating that, given a char c, the following: Code:text(new Integer(c).toString(), x, y) |
| could solve the problem (a bit overkill, isn't it?)
|
Ariel Malka | www.chronotext.org
|
|
|
fry
|
Re: text() and println()
« Reply #6 on: Jun 19th, 2003, 4:11pm » |
|
yeah, or: text(String.valueOf((int) c), x, y); but it's one of those annoying overkill things in java
|
|
|
|
|