Re: interrupting a repeat loop

2009-12-16 Thread Mark Wieder
Andre- Wednesday, December 16, 2009, 5:56:34 AM, you wrote: > Hi Alex, > We all love tail recursion optimizations! > Thanks for the code! If a recursive routine can be refactored into a "repeat forever" loop then it's probably a bad candidate for recursion. But it's hard to resist recursive rou

Re: interrupting a repeat loop

2009-12-16 Thread Andre Garzia
Hi Alex, We all love tail recursion optimizations! Thanks for the code! Cheers andre On Tue, Dec 15, 2009 at 10:09 PM, Alex Tweedly wrote: > Andre Garzia wrote: > >> Hi Folks, >> >> this been answered in many ways already but I thought I'd chime in and try >> to answer it in a different way. T

Re: interrupting a repeat loop

2009-12-15 Thread Kee Nethery
>> >> 2009/12/15 Tim Selander >> >> Is there any way in RR to check for user input during a repeat loop? I'd >>> like a loop to continue until the user types a certain key -- at which point >>> the script would exit the handler. In my code I have this sprinkled throughout all the repeat loops.

Re: interrupting a repeat loop

2009-12-15 Thread Alex Tweedly
Andre Garzia wrote: Hi Folks, this been answered in many ways already but I thought I'd chime in and try to answer it in a different way. The key is to think of reusable code, every now and them we keep rewritting the same pieces over and over again. How do we create a generic thing that will:

Re: interrupting a repeat loop

2009-12-15 Thread zryip theSlug
2009/12/15 zryip theSlug > > > 2009/12/15 Tim Selander > > Is there any way in RR to check for user input during a repeat loop? I'd >> like a loop to continue until the user types a certain key -- at which point >> the script would exit the handler. >> >> Tim Selander >> Tokyo, Japan >>

Re: interrupting a repeat loop

2009-12-15 Thread zryip theSlug
2009/12/15 Tim Selander > Is there any way in RR to check for user input during a repeat loop? I'd > like a loop to continue until the user types a certain key -- at which point > the script would exit the handler. > > Tim Selander > Tokyo, Japan > ___

Re: interrupting a repeat loop

2009-12-15 Thread Mark Wieder
Andre- Tuesday, December 15, 2009, 11:01:23 AM, you wrote: > But checking the recursionlimits on the dictionary, I see we can increase it > by code! :-O So, if you're going to comput something big, then increase > it!!! However, note that the default recursionlimit is actually 40, not the 10

Re: interrupting a repeat loop

2009-12-15 Thread Andre Garzia
Good question george, it depends on the works of dispatch call. Let me try something here, ok did try it, tried computing some big sums and factorials, it can reach recursion limit depending on memory usage but I've reached overflow before reaching recursion limits. But checking the recursionlimit

Re: interrupting a repeat loop

2009-12-15 Thread George C Brackett
Dumb question: could your approach result in too deep a recursion while looping some quick code? George On Dec 15, 2009, at 1:43 PM, Andre Garzia wrote: Hi Folks, this been answered in many ways already but I thought I'd chime in and try to answer it in a different way. The key is to think of

Re: interrupting a repeat loop

2009-12-15 Thread Andre Garzia
Hi Folks, this been answered in many ways already but I thought I'd chime in and try to answer it in a different way. The key is to think of reusable code, every now and them we keep rewritting the same pieces over and over again. How do we create a generic thing that will: 1) Run some code in a

Re: interrupting a repeat loop

2009-12-15 Thread Phil Davis
Another way to check for any key being down is: command runTheLoop repeat forever if the keysDown <> empty then exit repeat -- do what you want end repeat end runTheLoop HTH - Phil Davis On 12/15/09 7:59 AM, Robert Brenstein wrote: On 15.12.2009 at 16:01 Uhr +0100 Jacques H

Re: interrupting a repeat loop

2009-12-15 Thread Robert Brenstein
On 15.12.2009 at 16:01 Uhr +0100 Jacques Hausser apparently wrote: Hi Tim it depends of the kind of loop you are using. Several possibilities For example in a card script: local stoploop command runTheLoop repeat forever if stoploop = "S" then exit repeat -- do what you want

Re: interrupting a repeat loop

2009-12-15 Thread Jacques Hausser
Tim, I forgot two little things: local stoploop command runTheLoop put empty into stoploop -- as stoploop is a "permanent" variable, it should already contain "S" and the loop will not run repeat forever if stoploop = "S" then exit repeat -- do what you want wait 10 millisecon

Re: interrupting a repeat loop

2009-12-15 Thread Tim Selander
Works great; that's just the thing I was looking for! Thank you. Tim Selander Tokyo, Japan Jacques Hausser wrote: Hi Tim it depends of the kind of loop you are using. Several possibilities For example in a card script: local stoploop command runTheLoop repeat forever if stoploop =

Re: interrupting a repeat loop

2009-12-15 Thread Jacques Hausser
Sorry, it is "with messages", plural ! Le 15 déc. 2009 à 16:01, Jacques Hausser a écrit : > Hi Tim > > it depends of the kind of loop you are using. Several possibilities For > example in a card script: > > local stoploop > > command runTheLoop > repeat forever > if stoploop = "S" then

Re: interrupting a repeat loop

2009-12-15 Thread Jacques Hausser
Hi Tim it depends of the kind of loop you are using. Several possibilities For example in a card script: local stoploop command runTheLoop repeat forever if stoploop = "S" then exit repeat -- do what you want wait 10 milliseconds with message end repeat end runTheLoop o

interrupting a repeat loop

2009-12-15 Thread Tim Selander
Is there any way in RR to check for user input during a repeat loop? I'd like a loop to continue until the user types a certain key -- at which point the script would exit the handler. Tim Selander Tokyo, Japan ___ use-revolution mailing list use-revo