|
Author |
Topic: convert int to char (Read 602 times) |
|
st33d
|
convert int to char
« on: Mar 26th, 2005, 7:18pm » |
|
How do I make this work? Code: String input = ""; void setup(){} void loop(){ println(input); } void keyPressed(){ char keyInput = key; input = input+keyInput; } |
| I can't find any reference to derive a char or string from an int. The idea is to make a non standard textfield.
|
« Last Edit: Mar 26th, 2005, 7:19pm by st33d » |
|
I could murder a pint.
|
|
|
fry
|
Re: convert int to char
« Reply #1 on: Mar 27th, 2005, 12:20am » |
|
char keyInput = (char) key; will do the trick. or even just: input += (char) keyInput;
|
|
|
|
st33d
|
Re: convert int to char
« Reply #2 on: Mar 27th, 2005, 3:32am » |
|
Code: String input = ""; void setup(){} void loop(){} void keyPressed(){ if (key == 10){ println(input); input = ""; }else{ input += (char) key; } } |
| Magic. Thanks.
|
« Last Edit: Mar 27th, 2005, 3:33am by st33d » |
|
I could murder a pint.
|
|
|
|