Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alphabetical sort of characters within a string.
#57
(04-27-2024, 11:21 PM)I think bplus Wrote: back to using counting array ;-))
I think about the only way to see much improvements at this point, would be to change the approach completely.  At the moment, you're reading one word, processing one word, and writing routines to only work with one word at a time.

A vast improvement would be to:
1) read the whole list and store it in an array once and be done with it.
2) UCASE$ that whole list, if desired, once and be done with it.
3) Process that whole array at once, rather than puttering over 1 word at a time.  I imagine we could save a lot of overhead allocating memory in the functions, then freeing it, over and over, if we just did it all at once.

Bonus speed if you read the list as FIXED LENGTH strings, using space (CHR$(32)) as the end of line characters, and then swap to making use of _MEM to process everything.
Reply


Messages In This Thread
RE: Alphabetical sort of characters within a string. - by SMcNeill - 04-27-2024, 11:27 PM



Users browsing this thread: 11 Guest(s)