Input timeout
[1/5] from: mario::cassani::icl::com at: 11-Jul-2001 13:58
Hi all,
is there any way to "timeout" an 'input or an 'ask statement?
Is there, in /view, any way to do it with GUI input fields?
In other words, something like:
login: ask/delay "Enter your name or wait 10 seconds: " 5 "anonymous"
If not possible isn't it a good idea to add this feature?
>> ? ask
USAGE:
ASK question /hide /delay time default
DESCRIPTION:
Ask the user for input.
ASK is a function value.
ARGUMENTS:
question -- Prompt to user (Type: series)
REFINEMENTS:
/hide -- mask input with *
/delay -- give a maximum timeout and a default "input"
time -- (Type: number)
default -- (Type: string)
Best regards
Mario Cassani
[2/5] from: coussement:c:js:mil:be at: 11-Jul-2001 15:19
Hi Mario:
did you try:
>> ? inform
USAGE:
INFORM panel /offset where /timeout time
DESCRIPTION:
Display an exclusive focus panel for alerts, dialogs, and requestors.
INFORM is a function value.
ARGUMENTS:
panel -- (Type: object)
REFINEMENTS:
/offset
where -- Offset of panel (Type: pair)
/timeout <<<<<<<<<<<<<<<<<
time -- (Type: any)
OR
>> ? request
USAGE:
REQUEST str /offset xy /ok /only /confirm /timeout time
DESCRIPTION:
Requests an answer to a simple question.
REQUEST is a function value.
ARGUMENTS:
str -- (Type: string block object none)
REFINEMENTS:
/offset
xy -- (Type: any)
/ok
/only
/confirm
/timeout <<<<<<<<<<<<<<<
time -- (Type: any)
Cheers,
chr==
[3/5] from: slok00:y:ahoo at: 11-Jul-2001 6:43
personally, I would think that these are systems
function. More of a View calling/manipulating the
systems functions.
I may be wrong, just a thought.
YekSoon
--- Cassani Mario <[Mario--Cassani--icl--com]> wrote:
[4/5] from: mario:cassani:icl at: 11-Jul-2001 17:03
Hi YekSoon,
> > If not possible isn't it a good idea to add this
> > feature?
<<quoted lines omitted: 20>>
> function. More of a View calling/manipulating the
> systems functions.
That's the idea, as shown by Christophe (merci)
/view has its own system input timeout:
8<----------8<----------8<----------8<----------8<----------
>> ? inform
USAGE:
INFORM panel /offset where /timeout time
DESCRIPTION:
Display an exclusive focus panel for alerts, dialogs, and requestors.
INFORM is a function value.
ARGUMENTS:
panel -- (Type: object)
REFINEMENTS:
/offset
where -- Offset of panel (Type: pair)
/timeout <<<<<<<<<<<<<<<<<
time -- (Type: any)
8<----------
>> ? request
USAGE:
REQUEST str /offset xy /ok /only /confirm /timeout time
DESCRIPTION:
Requests an answer to a simple question.
REQUEST is a function value.
ARGUMENTS:
str -- (Type: string block object none)
REFINEMENTS:
/offset
xy -- (Type: any)
/ok
/only
/confirm
/timeout <<<<<<<<<<<<<<<
time -- (Type: any)
8<----------8<----------8<----------8<----------8<----------
while /core misses them.
It wanted to be a suggestion to add the feature in
/core too.
Nimenhao
Mario
[5/5] from: ryanc:iesco-dms at: 11-Jul-2001 10:15
maybe something like this?
input-timeout: function [t-o] [con] [
con: make port! [scheme: 'console]
wait [con 5]
either input? [input] [none]
]
This waits 5 seconds or until the console is used. Probably not what you
need, but easy to implement. If what you want is a so that it times out
in the middle of typing after x seconds, or if you have not typed in x
seconds, then a little more effort is required. For I will just give you
some scribbles that may resemble something usefull with a little work:
con: make port! [scheme: 'console]
o-c: open/wait con
timeout: now + 00:00:30
rv: copy ""
until [
either input? [
char: first o-c
if char <> #"^/" [append rv char]
] [ char: none ]
any [now > time-out char = #"^/"]
]
close o-c
return rv
--Ryan
Cassani Mario wrote:
> Hi all,
> is there any way to "timeout" an 'input or an 'ask statement?
<<quoted lines omitted: 21>>
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted