Re: I want to convert a list of integers to their negative self
Re: I want to convert a list of integers to their negative self
- Subject: Re: I want to convert a list of integers to their negative self
- From: Jed Verity <email@hidden>
- Date: Wed, 28 Feb 2001 13:45:53 -0800
What about:
set A to {"1","3","7"}
repeat with i from 1 to length of A
set item i of A to ((item i of A as integer)*-1) as string
end
HTH,
Jed
On 5/9/00 4:38 PM, you seemed to think this was important:
>
Hi all,
>
>
I want to convert a list of integers to their negative self
>
>
{"1", "3", "7", "", ""}
>
>
To:
>
>
{"-1", "-3", "-7", "", ""}
>
>
I have this;
>
>
set B to (the count of every item of A)
>
set This_List to {}
>
set c to 1
>
repeat with i from 1 to B
>
--
>
set c to c * i
>
set item c of A to D as integer
>
set E to D + D - D
>
set This_List to (This_List & D) as string
>
end repeat
>
display dialog This_List
>
end tell
>
>
But because I'm not handy with this, I get a bad result.
>
I could not find the trick anywhere in my books :-(
>
>
Thanks for the input
>
~)~)~)~)~)~)~)~)~)~)~)~)~)
Jed Verity