Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!netnews.upenn.edu!V050FN5R@UBVMS.BITNET From: V050FN5R@UBVMS.BITNET (Maurice Volaski) Newsgroups: comp.sys.mac.hypercard Subject: recursion Message-ID: <9984@netnews.upenn.edu> Date: 17 Apr 89 01:39:11 GMT Sender: news@netnews.upenn.edu Distribution: comp Lines: 22 Approved: bell@eniac.seas.upenn.edu I am trying to write a function that does search and replace of strings in a stack. Basically, it is a function of the form replace "wordToFind","howToLook","replaceWithThis" Once entered into the message box, the the function begins to work, but after a number of times, it stops with a too much recursion error. Does anyone have an idea why? Internally, the function puts the wordToFind and ReplaceWithThis into global variables then proceeds to find wordToFind. It then gets the position of this wordToFind in a field that the find command found it in by using the foundchunk. It replaces the wordToFind that is in the field at that location, then proceeds by calling finding again recursively. It may be that the calling of find is being nested many times. Is there any way to make act as if it were being called fresh each time? Thanks a lot for any help. Maurice