• 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: Sequential IF Processing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sequential IF Processing


  • Subject: Re: Sequential IF Processing
  • From: Nigel Garvey <email@hidden>
  • Date: Sat, 30 Apr 2011 20:54:57 +0100

Marconi wrote on Sat, 30 Apr 2011 09:43:32 -0700:

>There must be something very basic that I'm
>failing to understand. In the following code,
>unless testValue > 3600, the minutes IF statement
>does not get processed.
>
>set testValue to "3599.59"
>set final to ConvertSecs(testValue)

Your input value is text.

"3599.59" >= 60 becomes "3599.59" >= "60" and the comparison is done
lexically instead of numerically. You need to coerce the input to a
number, perhaps at the top of the handler:

>display dialog "Padded = " & final
>
>
>
>on ConvertSecs(theSecs)
>
>	set HH to 0
>	set MM to 0
>	set SS to 0
   set Remaining to theSecs as number


NG

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Sequential IF Processing
      • From: Marconi <email@hidden>
  • Prev by Date: Sequential IF Processing
  • Next by Date: Re: Sequential IF Processing
  • Previous by thread: Sequential IF Processing
  • Next by thread: Re: Sequential IF Processing
  • Index(es):
    • Date
    • Thread