in another post, http://www.powerbasic.com/support/pb...ad.php?t=20285
i asked for a more efficient way to sort the letters in a word.
jose's reply sparked a remembrence and i modified a short sort
routine i developed in the days of the ti/99-4a.
got it to work okay in cc but since cc doesn't have mtimer, i
copied it over the pb/dos and did some minor restructure so i
could see how fast it operates. here is the dos version:
it compiles okay but trying to run it produces an "illegal function
call" on line 10 and i can't figure out why. the exact same thing
compiles and runs fine under cc but not dos. i am running xp/pro.
any ideas? thanks.
------------------
[this message has been edited by mel bishop (edited october 19, 2003).]
i asked for a more efficient way to sort the letters in a word.
jose's reply sparked a remembrence and i modified a short sort
routine i developed in the days of the ti/99-4a.
got it to work okay in cc but since cc doesn't have mtimer, i
copied it over the pb/dos and did some minor restructure so i
could see how fast it operates. here is the dos version:
Code:
$lib all off $error all on color 14,1 cls text$ = "zyxwvutsrqponmlkjihgfedcba" locate 1,1 : print;text$; text$ = sortword$(text$) locate 2,1 : print;text$; end function sortword$(text$) for x = 2 to len(text$) l = x 10 do until mid$(text$,l,1) => mid$(text$,l-1,1) or l = 1 s1$ = mid$(text$,l-1,1) mid$(text$,l-1,1) = mid$(text$,l,1) mid$(text$,l,1) = s1$ l = l - 1 loop next x function = text$ end function
call" on line 10 and i can't figure out why. the exact same thing
compiles and runs fine under cc but not dos. i am running xp/pro.
any ideas? thanks.
------------------
[this message has been edited by mel bishop (edited october 19, 2003).]
Comment