User:Eriksiers/Permute a string: Difference between revisions

Content added Content deleted
m (added a note)
m (VB note)
Line 3: Line 3:
Note that this is heavily recursive, adding a level of recursion for each character in the string. Long strings will run out of stack space pretty fast.
Note that this is heavily recursive, adding a level of recursion for each character in the string. Long strings will run out of stack space pretty fast.


Note also that the sub works unchanged in [[Visual Basic]] and [[PowerBASIC]]. Probably other [[BASIC]]s too, but I haven't checked.
Note also that the sub works almost unchanged in [[Visual Basic]] (if you change the output method, e.g. <code>'''PRINT'''</code>-><code>'''PRINT #'''</code>) and [[PowerBASIC]]. Probably other [[BASIC]]s too, but I haven't checked.


<lang qbasic>DECLARE SUB Permute (unchanged$, volatile$)
<lang qbasic>DECLARE SUB Permute (unchanged$, volatile$)