• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: simple math equations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple math equations


  • Subject: Re: simple math equations
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Thu, 01 Mar 2001 12:28:14 -0500

> Date: Thu, 01 Mar 2001 11:04:03 -0500
> Subject: Re: simple math equations
> From: "Arthur J Knapp" <email@hidden>

> Perhaps he is looking for an interface, like an AppleScript calculater:

Here is a slightly different version of the script I posted earlier:


set val to ""

repeat -- "quit" by pressing "Cancel"

display dialog "Please enter an expression" default answer val

-- Any one-line AppleScript expression
--
set exp to text returned of result -- ie: "1 / 0"

try
set val to run script exp
on error m number n
set val to m & n -- > ie: "Can't divide 1.0 by zero."
end try
end repeat


The "default answer" simply becomes the result of the previous
expression, and if the previous expression caused an error, the
error message gets throw back at you without halting execution.


Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
http://www.AppleScriptSourceBook.com


  • Prev by Date: Re: Making a log file
  • Next by Date: Return a value while continuing
  • Previous by thread: Re: simple math equations
  • Next by thread: Re: Arthur Knapp not being recognized by script object
  • Index(es):
    • Date
    • Thread