English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 26 May 2013, 16:28   #1
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
ask like command with timeout (and default option)

Hi,

anyone seen a command like "ask" I can use in shell scripts that lets me answer yes/no like ask but times out without user input to a default. (yes or no)?

I saw some website that that says ask takes a timeout option... but it doesn't.
Vot is offline  
Old 26 May 2013, 17:08   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Unfortunately it is not possible to time out a Read() request from a CON window. This means any program which takes editable input cannot time out. But a program can temporarily switch the window into RAW mode and wait for a single key press.

Here is an example: http://thomas-rapp.homepage.t-online...aitForChar.lha
thomas is offline  
Old 27 May 2013, 14:30   #3
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
Quote:
Originally Posted by thomas View Post
Unfortunately it is not possible to time out a Read() request from a CON window. This means any program which takes editable input cannot time out. But a program can temporarily switch the window into RAW mode and wait for a single key press.

Here is an example: http://thomas-rapp.homepage.t-online...aitForChar.lha
Wow. thanks that's exactly what I was after.. thanks a lot I wouldn't have come up with that myself.. didn't realise about the con restriction.

Btw.. the failat and if warn just use the return code from main do they ?
(0 - Ok, 5 - Warn, 10 - Error, 20 - Fail)
Vot is offline  
Old 27 May 2013, 18:00   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Btw.. the failat and if warn just use the return code from main do they ?
(0 - Ok, 5 - Warn, 10 - Error, 20 - Fail)
Yes, that's right. Although some programs (mostly intros/demos) don't care what they return, so return codes can be far outside this range.

If a program returns -1, you get a "unknown command" message although the command was executed.
thomas is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cnet.device dma timeout getting hardware station address voyager support.Hardware 1 21 June 2013 14:21
Server timeout issue andreas project.EAB 11 23 June 2011 04:49
Default Tools Yoto support.Apps 3 25 February 2009 15:00
Default draw Retro1234 support.Other 1 02 July 2006 17:14
500 Gateway Timeout error. Amiga1992 project.EAB 3 04 December 2001 22:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:13.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07075 seconds with 13 queries