RE: Wind Chill (corrected & full)
RE: Wind Chill (corrected & full)
- Subject: RE: Wind Chill (corrected & full)
- From: email@hidden
- Date: Fri, 1 Mar 2002 02:51:59 EST
Sorry about the partial answer in the last post; accidentally sent the
message while it was incomplete.
The code to do what you ask, Rob:
tell application "Finder"
display dialog "Please enter the temp in degrees Fahrenheit: " buttons {"
Cancel", "OK"} ,
default button 2 default answer "54"
set TheEntryTemp to the text returned of the result as string -- don't
force the coercion yet
display dialog "Please enter the wind speed in miles per hour: " buttons
{"Cancel", "OK"} ,
default button 2 default answer "10"
set TheEntryMPH to the text returned of the result as string
-- insert a little error checking to make sure a number was entered for
each and in range here (-220 to +210 for temp, 0 to 240 for MPH ). You can
write that yourself :)
set TheTemp to TheEntryTemp as integer
set TheSpeed to TheEntryMPH as integer
set TheWindChill to (35.74 + (0.6215 * TheTemp) - (35.75 * TheSpeed * 0.16
) + (0.4275 * TheTemp * TheSpeed * 0.16))
display dialog "The temp including wind chill is: " & TheWindChill
buttons {"OK"} default button 1
end tell
Best Wishes,
Marc Glasgow
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.