I am currently in the process of learning Rebol.
In other languages I know, I can read input from the command line, for example in Java:
Scanner sc = new Scanner(System.in)
sc.nextLine();
In C#
Console.ReadLine();
In C
scanf("%s", s);
I was wondering how one would accomplish the same thing in Rebol.
You can use the input command to ask for input at the console.
>> name: input
Joe
== "Joe"
The ask function complements input by printing a string prior to requesting input:
age: ask "How old are you? "
It also has a /hide refinement to conceal input:
pass: ask/hide "Enter your password: "
At this time, /hide is not implemented in Rebol 3 alphas
A longer answer (and for intermediate-level at least) would include monitoring the system/ports/input port (you can do source input for how this is done for you)—this can be used in cases where input doesn't originate at the console (such as shell, CGI).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With