Hello list members,

I just asked myself why my code no more worked well when I inserted some query 
using the ask or input instructions.

Before the insert the code was working correctly even if I I transfered it to 
the open console (View 1.3.1) using CUT AND PASTE from
my editor's window. When I added an ask or an input to stop the running script, 
REBOL then considered the entry completed - probably
due to the implicit NEWLINE that exists between the lines - and never really 
asked me to type something as an entry to my ask
instruction.

To remedy to this situation I have to save my code to a file script (.r) and 
execute this new script using do. Then it works but I
simply asks myself if there is no other way to control the ask behaviour to 
normally process the script as the DO is doing itself.

Is there not some magic switch that REBOL uses to control this facet of life ?

Below is some code to illustrate the faulty behaviour (to my eyes):

Every comment is appreciated,
Regards,
Gerard

CODE
=====

crit: "file"
crit: ask "Enter your own criterion? "
print "own label"                                 <-- none or one Newline can 
be inserted here
print crit                                                    after the line 
containing the ask


Try #1:   No newline after the ask
=====
>> crit: "file"
== "file"
>> crit: ask "Enter your own criterion? "
Enter your own criterion? print "own label"     <-- when no Newline is present
== {print "own label"}                                          REBOL considers 
the next line
>> print crit                                                          as the 
>> string entered by the user
print "own label"

Try #2:   One newline after the ask
=====
>> crit: "file"
== "file"
>> crit: ask "Enter your own criterion? "
Enter your own criterion?                            <-- Here the Newline is 
considered by REBOL
== ""                                                                as the end 
of the ask and this means the "" is
>> print "own label"                                            returned as the 
>> new value of the crit word.
own label
>> print crit



-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to