• 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
Recursion Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recursion Problem


  • Subject: Recursion Problem
  • From: Michael D Mays <email@hidden>
  • Date: Sun, 30 Jun 2013 12:33:48 -0500

Hi,

I would expect that when I run the script below that do_that would recursively call itself until a true was returned and then "I escaped" would be displayed. What repeatedly happens is two false's are returned and then the "I escaped" dialog is displayed even though true has not been return. 

Where am I going wrong?

Thanks,
Michael


on do_this()
if not do_that() then do_that()
display dialog "I escaped"
end do_this

on do_that()
set a_list to {false, false, false, false, false, false, false, false, false, true}
set a_random_number to (random number from 1 to 10)
display dialog (a_random_number as string) & " " & item a_random_number of a_list
return item a_random_number of a_list
end do_that
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Recursion Problem
      • From: Luther Fuller <email@hidden>
    • Re: Recursion Problem
      • From: Alex Hall <email@hidden>
References: 
 >Applescript to print Odd Pages only (From: Bill Guion <email@hidden>)

  • Prev by Date: Re: bounce emails in Mt Lion
  • Next by Date: Re: Recursion Problem
  • Previous by thread: Re: Applescript to print Odd Pages only
  • Next by thread: Re: Recursion Problem
  • Index(es):
    • Date
    • Thread