Re: Coercion problem
Re: Coercion problem
- Subject: Re: Coercion problem
- From: Nigel Garvey <email@hidden>
- Date: Tue, 15 Jun 2004 08:32:44 +0100
Nigel Smith wrote on Mon, 14 Jun 2004 12:40:40 +0100:
>
On 10/6/04 22:40, "Al Wirtes" <email@hidden> wrote:
>
>
> -- pick your hashed directory
>
>
To save yourself some typing, how about:
>
>
set tmp to LNum - (LNum mod 500) + 1
>
set LHash to (text -4 thru -1 of ("000" & tmp)) & "-" & <no-break>
>
text -4 thru -1 of ("000" & (tmp + 499)) & ":"
Nice one, Nigel. :-) But the formula for tmp needs adjusting to
compensate for when LNum is the top number in a range:
set tmp to (LNum -1) div 500 * 500 + 1
>
Though someone may come up with something simpler...
The best I can manage is:
tell (LNum - 1) div 500 * 5000500 + 100010500 as string to <no-break>
set LHash to text 2 thru 5 & "-" & text 6 thru 9 & ":"
:-)
NG
_______________________________________________
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.