Re: Sequential IF Processing
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