On 28/4/00 10:26 pm, Nicolas Cueto <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> Does mc have a specific function that, like caseSensitive, restricts
> data-input to numbers? If not, any alternate suggestions? Use matchText or
> offset, right?
> 
> I ask because, after implementing Nelson Zink's clock-timer script (thank
> you!), I realized what some misguided (evil minded?!) user could do when
> prompted by:
> 
> ask "Count down how many seconds?" with 300

You should check that such input is a number, and put up an error if not:

if it is not a number then --error

Or create a custom dialog and check that the key pressed in the field is a
number:

on keyDown pWhich
  if pWhich is not a number then exit keyDown
  pass keyDown
end keyDown

> (BTW I wonder how a standalone version would react to a deliberate misuse
> in this manner of an ask-field? As a stack, mc handled the error, but, as a
> standalone? Guess I'll go find out. Hee-hee!)

It won't do anything (unless you include the error dialog) - it will simply
stop executing the script when it finds an error.

Regards,

Kevin

> Cheers.
> 
> Nicolas R Cueto

Kevin Miller <[EMAIL PROTECTED]> <http://www.xworlds.com/>
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to