How to Read Keyboard Input

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to Read Keyboard Input

highbeg
Hi Everyone,

I'm sure it's possible but I sure can't figure out how. I consulted very
well written papers by Valencia Consulting and the Bluebook and still
haven't a clue how to read the keyboard from a running Smalltalk program
(in C getchar() , scanf(), etc. are used).

Any help would be appreciated.

Thank you,

Gary Highberger
Reply | Threaded
Open this post in threaded view
|

Re: How to Read Keyboard Input

Gnu mailing list
You want to look into the methods in the accessing-reading protocol of the Stream class.
Link to the manual: https://www.gnu.org/software/smalltalk/manual-base/gst-base.html#Stream_002daccessing_002dreading

e.g. to read a line from stdin, you can do

stdin nextLine.


> On Jan 13, 2021, at 7:58 PM, Gary Highberger <[hidden email]> wrote:
>
> Hi Everyone,
>
> I'm sure it's possible but I sure can't figure out how. I consulted very
> well written papers by Valencia Consulting and the Bluebook and still
> haven't a clue how to read the keyboard from a running Smalltalk program
> (in C getchar() , scanf(), etc. are used).
>
> Any help would be appreciated.
>
> Thank you,
>
> Gary Highberger
>

Reply | Threaded
Open this post in threaded view
|

Re: How to Read Keyboard Input

highbeg
I didn't realize the standard streams, stderr, stdin, and stdout were
available in Smalltalk as objects. I can take it from here. Thank you for
enlightening me Felipe!
Gary

On Thu, Jan 14, 2021, 12:13 AM Felipe BaƱados Schwerter <
[hidden email]> wrote:

> You want to look into the methods in the accessing-reading protocol of
> the Stream class.
> Link to the manual:
> https://www.gnu.org/software/smalltalk/manual-base/gst-base.html#Stream_002daccessing_002dreading
>
> e.g. to read a line from stdin, you can do
>
> stdin nextLine.
>
>
> On Jan 13, 2021, at 7:58 PM, Gary Highberger <[hidden email]>
> wrote:
>
> Hi Everyone,
>
> I'm sure it's possible but I sure can't figure out how. I consulted very
> well written papers by Valencia Consulting and the Bluebook and still
> haven't a clue how to read the keyboard from a running Smalltalk program
> (in C getchar() , scanf(), etc. are used).
>
> Any help would be appreciated.
>
> Thank you,
>
> Gary Highberger
>
>
>