Keyboard Scanner made easy!
Author |
Message |
jeffgreco13
![](http://compsci.ca/v3/uploads/user_avatars/21290830414888dd996a022.jpg)
|
Posted: Tue Sep 16, 2008 10:55 am Post subject: Keyboard Scanner made easy! |
|
|
Here's the Keyboard Scanner function made into an object. Very, very simple to use...
code: |
...
variable1 = reader1.readDouble(); // Reads a double value and assigns it to variable1
variable2 = reader1.readInt(); // Reads an integer
variable3 = reader1.readBoolean(); // Reads boolean value, True or False
variable4 = reader1.readChar(); // Reads a Character value, ASCII
variable5 = reader1.readDoubleLine(); // Reads double values on one line, returns an array of values separated by whitespace
variable6 = reader1.readIntLine(); // Reads integer values on one line, returns array of values separated by whitespace
variable7 = reader1.readCharLine(); // Same with character values, ASCII
variable8 = reader1.readString(); // Reads a string
...
|
So many more constructors can be added to modify the input before it is returned, the possibilities are endless.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
reader1.java |
Filesize: |
8.55 KB |
Downloaded: |
238 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
jeffgreco13
![](http://compsci.ca/v3/uploads/user_avatars/21290830414888dd996a022.jpg)
|
Posted: Tue Sep 16, 2008 5:33 pm Post subject: Re: Keyboard Scanner made easy! |
|
|
ok... shortcut then.. thats what this is
|
|
|
|
|
![](images/spacer.gif) |
Euphoracle
![](http://compsci.ca/v3/uploads/user_avatars/11170373664bf5f25f636f1.png)
|
Posted: Tue Sep 16, 2008 9:38 pm Post subject: RE:Keyboard Scanner made easy! |
|
|
Shortcut to what? It's an alias, essentially.
|
|
|
|
|
![](images/spacer.gif) |
|
|