|
Post by tmbgfn on May 31, 2003 21:32:32 GMT
Hi, first post I have a question about nested loops. How deep can they go? I'm trying to make an alpha-sorting routing and keep getting NEXT without FOR error and far as I can tell they all match up. If I REM out the IF THEN statements between the loops I don't get the error...any ideas or better code?(or working code) Thanks FOR J = 1 TO ENTRY FOR K = (J+1) TO ENTRY FOR L =1 TO C IF D$(L) < W$(K) SWAP D$(L) , W$(K) IF W$(K) < W$(J) SWAP W$(K), W$(J) IF D$(L) < W$(J) SWAP D$(L), W$(J) END IF NEXT L NEXT K NEXT J
|
|
|
Post by buffoasys on May 31, 2003 23:31:10 GMT
The obvious is that (assuming this is the exact code) you have one end if and 3 multi-line ifs.
Also, don't see any then after the if statments. (Unless you are using THEOS multiuser basic you will probably need the then)
|
|
|
Post by buffoasys on May 31, 2003 23:33:53 GMT
As far as a better sort routine, QuikSort is the fastest non-asm sort i've seen. I think there's an example on my site pages.sbcglobal.net/oasys
|
|
|
Post by tmbgfn on Jun 1, 2003 0:57:34 GMT
Thanks I forgot to type the "THEN" statements here. And yes if was the END IF's. Must have been staring at it too long.
I'm gonna check out the Quiksort code too.
Thanks again
|
|
|
Post by ABCD on Nov 30, 2017 9:58:50 GMT
How to solve the question 1 2 6 3 7 10 4 8 11 13 5 9 12 14 15
|
|