Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Input timeout

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? > 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 > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Ryan Cole Programmer Analyst www.iesco-dms.com 707-468-5400