• 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
Question about repeat loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about repeat loop


  • Subject: Question about repeat loop
  • From: Phil Calvert <email@hidden>
  • Date: Sat, 14 Jul 2001 09:47:31 -0700

Hi list,

Can someone tell me why the "if ((TheItem1) is (TheItem2))" is never true in
this bit of code but "if ((TheItem1 as text) is (TheItem2 as text))" is
true?

--


set list1 to {"I", "want", "this", "to", "work"}
set list2 to {"please", "work"}

repeat with TheItem1 in list1
repeat with TheItem2 in list2
if ((TheItem1) is (TheItem2)) then--this is never true
display dialog "I'm in the if 1"
exit repeat
end if
end repeat
end repeat

repeat with TheItem1 in list1
repeat with TheItem2 in list2
if ((TheItem1 as text) is (TheItem2 as text)) then--this works
display dialog "I'm in the if 2"
exit repeat
end if
end repeat
end repeat

--


TIA,

Phil


  • Follow-Ups:
    • Re: Question about repeat loop
      • From: Paul Skinner <email@hidden>
    • Re: Question about repeat loop
      • From: Emmanuel <email@hidden>
    • Re: Question about repeat loop
      • From: Bill Briggs <email@hidden>
  • Prev by Date: can't make { . . . } into an item [error message]
  • Next by Date: Re: Question about repeat loop
  • Previous by thread: Re: can't make { . . . } into an item [error message]
  • Next by thread: Re: Question about repeat loop
  • Index(es):
    • Date
    • Thread