Re: Yes/No -> Si/No / ixnay / better input routine

From: Alfie Costa (agcosta@gis.net)
Date: Mon Jun 25 2001 - 20:44:00 CEST


On 25 Jun 2001, at 15:37, Michele Andreoli <mulinux@sunsite.dk> wrote:

AC > Better to prevent bad input. Given a (y/n) prompt, if the user types 'j',
AC > the computer should just beep, or if there was no sound, the screen could
AC > make a face. The script would accept only yYnN or <Enter>. Some util
AC > like MsDos' 'CHOICE' or BASIC's 'INKEY$' would be needed though.
...
> This requires a lot of changes in any script, because translation** do
> not apply to the code itself.

Changing existing code to use a 'CHOICE'-like util would require some tweaking.
This would be worthwhile, assuming it was done well, if it made the code
smaller, easier to read, and easier to run.

Or suppose for the sake of argument that no existing scripts were tweaked to
use such a util... too much work, nobody wants to do it, or has the time, and
there's always the danger of introducing new bugs.

Even so, a 'CHOICE'-like util would make new scripts easier to write -- all
other things being equal, wouldn't you rather write one line of code instead of
three or four?

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:19 CET