Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
phone number to words
#13
(07-02-2024, 08:05 PM)Pete Wrote: I avoid making recursive calls within a sub to avoid stack space issues. Those were a big deal in QB, but not so much in QB64. I would assign a variable, exit the sub, and the next statement would determine to either re-loop the subroutine or move on.

Code: (Select All)
DO
MySub x
IF x = 1 THEN EXIT DO
LOOP

Mysub
a = INT(RND * 20)
IF a = 5 THEN x = 1
END SUB

Pete

ah took me a moment to figure what was recursive, oh the QuickSort.

That one has been dependable for years, unless miss-coded there is no danger of a runaway stack space blowing out memory, it needs less and less space on each call. on average it divides in half each time and from math we know the limit of the sum of halfing is 2, or twice the array size.

Ha just made that up, sounds pretty good right? it may be actually correct Smile
Zenos Tortoise and Hare Paradox is not.
b = b + ...
Reply


Messages In This Thread
phone number to words - by Jack - 06-30-2024, 02:44 AM
RE: phone number to words - by SMcNeill - 06-30-2024, 05:54 AM
RE: phone number to words - by Jack - 06-30-2024, 07:56 AM
RE: phone number to words - by bplus - 06-30-2024, 10:18 AM
RE: phone number to words - by bplus - 06-30-2024, 11:42 AM
RE: phone number to words - by SMcNeill - 06-30-2024, 12:31 PM
RE: phone number to words - by xerxes - 06-30-2024, 01:33 PM
RE: phone number to words - by Jack - 06-30-2024, 01:08 PM
RE: phone number to words - by SMcNeill - 06-30-2024, 01:45 PM
RE: phone number to words - by Pete - 07-02-2024, 06:22 PM
RE: phone number to words - by bplus - 07-02-2024, 07:40 PM
RE: phone number to words - by Pete - 07-02-2024, 08:05 PM
RE: phone number to words - by bplus - 07-02-2024, 10:52 PM
RE: phone number to words - by Pete - 07-03-2024, 01:46 AM



Users browsing this thread: 2 Guest(s)