• 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
Re: I want to convert a list of integers to their negative self
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Paths
  • Next by Date: Re: Display Dialog
  • Previous by thread: Re: Paths
  • Next by thread: Re: I want to convert a list of integers to their negative self
  • Index(es):
    • Date
    • Thread