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

Sequential IF Processing


  • Subject: Sequential IF Processing
  • From: Marconi <email@hidden>
  • Date: 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)
display dialog "Padded = " & final



on ConvertSecs(theSecs)

	set HH to 0
	set MM to 0
	set SS to 0
	set Remaining to theSecs
	display dialog "remaining is: " & Remaining
	if Remaining „ 3600 then
		set HH to round of (Remaining / 3600) rounding down
		set Remaining to Remaining - (HH * 3600)
	end if

	-- with a testValue of less than 3600, the following does not execute

	if Remaining „ 60 then
		set MM to round of (Remaining / 60) rounding down
		set Remaining to Remaining - (MM * 60)
	end if

	set SS to Remaining
	set theResult to Pad(HH) & ":" & Pad(MM) & ":" & Pad(SS)
	return theResult
end ConvertSecs

on Pad(theValue)
	set theResult to theValue as text
	if theValue < 10 then set theResult to "0" & theValue as text
	return theResult
end Pad

Why doesn't the second IF process? Or, why is it coming up False for being >= 60 when Remaining is much more?

It's just two IF statements, one after the other. The second doesn't execute unless the first is TRUE. Why?




_______________________________________________ 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
  • Prev by Date: Re: beep
  • Next by Date: Re: Sequential IF Processing
  • Previous by thread: Re: beep
  • Next by thread: Re: Sequential IF Processing
  • Index(es):
    • Date
    • Thread