spector@vx2.NYU.EDU (David HM Spector) (09/05/88)
I keep running into a strange problem in a set of stacks I am writing, and maybe someone out there has seen this and tell me what I am doing wrong. I keep running into the error message "Too much recursion". Now, looking at my HyperTalk scripts, I have _nothing_ that calls either 1) another script recur- sively, or 2) another stack recursively. What I do have are a number of things like the following: Example 1: -- This kind of script is usually called from a button or a mouseUp -- in a field set lockscreen to true push card go to stack "SomeOtherStack" (get some information or do something) pop card set lockscreen to false Example 2: -- This kind is usually in the Stack's script. on closeStack global tmpList put empty into tmpList set lockscreen to true repeat with i = 1 to number of cards put bg field "Name" after last line of tmpList end repeat -- then do something like example #1 to store the tmpList in a real -- field somewhere in another stack... end closeStack Am I seriously missing the boat here? Why do I get the recursion errors? Should all things that might jump around between stacks where other stack level scripts might be called go into the backgroung handler for the particular card background I am working with? Any ideas, suggestions and insights would be greatly appreciated... Thanks, _DHMS ------------------------------------------------------------------------------- David HM Spector New York University Senior Systems Programmer Graduate School of Business ARPAnet: SPECTOR@GBA.NYU.EDU Academic Computing Center USEnet:...!{allegra,rocky,harvard}!cmcl2!spector 90 Trinity Place, Rm C-4 HamRadio: N2BCA MCIMail: DSpector New York, New York 10006 AppleLink: D1161 CompuServe: 71260,1410 (212) 285-6080 "What computer puts out work like this?" "Hire us and we'll tell you."
armond@sdsu.UUCP (Armond Mehrabian) (09/07/88)
In article <3150006@vx2.NYU.EDU>, spector@vx2.NYU.EDU (David HM Spector) writes: > I keep running into a strange problem in a set of stacks I am writing, and > maybe someone out there has seen this and tell me what I am doing wrong. > >(stuff deleted) > > Any ideas, suggestions and insights would be greatly appreciated... > > Thanks, > _DHMS I ran into the same problem a while back, without any help as to what it might be. The best I could do is figure that "goto" is more like a "gosub", so to exit a card, use the "exit" statement, else you will wind yourself into a mess. Anyone who is a little more HyperTalk adept can correct me, but when I asked this same question two months ago, I got no answer but this. _dave_
spector@vx2.NYU.EDU (David HM Spector) (09/07/88)
I think I have found the (a) solution... It seems that when you jump around between stacks, there is some interaction between the _stack_level_ scripts. The solution is to do a "set lockMessages to true" just before you do something like 'go to stack "SomeOtherStack"' and then set lockMessages back to false when you're done. lockMessages (according to Goodman's HC Developer's Guide) disables all messages (except idle) until turned off. Its primary use (and the one I am using it for) is to let you jump somewhere else (another stack), snarf some data, and then get back without having another stacks scripts start running, which might do all sorts of unteneded things... _DHMS ------------------------------------------------------------------------------- David HM Spector New York University Senior Systems Programmer Graduate School of Business ARPAnet: SPECTOR@GBA.NYU.EDU Academic Computing Center USEnet:...!{allegra,rocky,harvard}!cmcl2!spector 90 Trinity Place, Rm C-4 HamRadio: N2BCA MCIMail: DSpector New York, New York 10006 AppleLink: D1161 CompuServe: 71260,1410 (212) 285-6080 "What computer puts out work like this?" "Hire us and we'll tell you."
spector@vx2.NYU.EDU (David HM Spector) (09/07/88)
I think I have found the (a) solution... It seems that when you jump around between stacks, there is some interaction between the _stack_level_ scripts. The solution is to do a "set lockMessages to true" just before you do something like 'go to stack "SomeOtherStack"' and then set lockMessages back to false when you're done. lockMessages (according to Goodman's HC Developer's Guide) disables all messages (except idle) until turned off. Its primary use (and the one I am using it for) is to let you jump somewhere else (another stack), snarf some data, and then get back without having another stacks scripts start running, which might do all sorts of unintended things... _DHMS ------------------------------------------------------------------------------- David HM Spector New York University Senior Systems Programmer Graduate School of Business ARPAnet: SPECTOR@GBA.NYU.EDU Academic Computing Center USEnet:...!{allegra,rocky,harvard}!cmcl2!spector 90 Trinity Place, Rm C-4 HamRadio: N2BCA MCIMail: DSpector New York, New York 10006 AppleLink: D1161 CompuServe: 71260,1410 (212) 285-6080 "What computer puts out work like this?" "Hire us and we'll tell you."
chrisj@ut-emx.UUCP (Chris Johnson) (09/12/88)
I can tell you what too much recursion is. But, better still, let me show you. Just attach the following script to a button anytime you want a recursion error. on mouseUp get Level1() end mouseUp function Level1 get Level2() end Level1 function Level2 get Level3() end Level2 function Level3 get Level4() end Level3 function Level4 get Level5() end Level4 function Level5 get Level6() end Level5 function Level6 get Level7() end Level6 function Level7 get Level8() end Level7 function Level8 get Level9() end Level8 function Level9 end Level9 As you can see this is not recursion by any traditional definition (at least not one that I know of). 'Recursion' in this case seems to mean 'levels of subroutines'; which is why the above script will generate the 'recursion' error when it reaches the "get Level9()" call. [It reminds me of my old HP-41 calculator - it only had a seven level return stack.] For me, this error is really a serious problem. Evidently, though, it doesn't effect most HyperCard users. I should add that if you make all of those functions into procedures, the 'Recursion' error doesn't show up. It seems likely that its still there, but you may have to go quite a few levels deeper to find it. ----Chris