Re: Second-Time conversion
Re: Second-Time conversion
- Subject: Re: Second-Time conversion
- From: Martin Orpen <email@hidden>
- Date: Thu, 24 Jun 2004 18:28:08 +0100
on 24/6/04 5:46 pm, Graff at email@hidden wrote:
>
One thing you might want to change is the second return in the leadZero
>
handler. The way it is now you either return a string or a number,
>
depending on whether or not the number is less than 10. If you change
>
the second return to this then it will always return a string:
>
>
return "" & x
>
>
What you have right now works simply because you later coerce the
>
returned value to a string, so it doesn't matter if it is a string or a
>
number. If you put the coercion into the handler in the first place
>
you cut down the chances of a bug down the road.
Thanks for the tip.
That's one of my trademarks - some days they work, some days they don't :-)
Actually, I need to start getting a bit more serious about this kind of
thing. Most of the stuff I script is run on Macs that I administer, so I can
patch things up when a problem is encountered.
Recently I've been posting snippets to our site and have come to realise how
badly the scripts perform in the *real world*.
So something like the script I use to monitor the odd fluctuations in
temperature of my laptop:
http://prometheus.idea-digital.com/phpbb2/viewtopic.php?t=252
Works like a dream on *my* laptop - but fails miserably on anything else
apart from recent 1.25 and 1.5GHz powerbooks running Panther 10.3.4.
Is there any easy way of ironing out problems like this, or is it just a
case of trial and error and maintaining an extensive (and expensive)
collection of hardware and software to test stuff out on?
Does using something like Script Debugger make this process easier I wonder?
Regards
--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
_______________________________________________
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.