Author Topic: Sorting Issue  (Read 1321 times)

0 Members and 1 Guest are viewing this topic.

cmwade77

  • Swamp Rat
  • Posts: 1443
Sorting Issue
« on: July 12, 2018, 06:36:57 PM »
Ok, I know I have to be missing something obvious, I want this to sort the text from the top down based on the order in the NoteTypes variable when using the "NT" command. I can't seem to find a way to do this yet.

Any help us greatly appreciated.

EDIT: I post and then I get it to work, but the text occasionally doesn't place correctly, any ideas?
« Last Edit: July 12, 2018, 06:44:03 PM by cmwade77 »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Sorting Issue
« Reply #1 on: July 12, 2018, 09:45:16 PM »
Perhaps you should post an example of what fails to sort correctly.This keeps the reader form having to fully test your lisp.

I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Sorting Issue
« Reply #2 on: July 13, 2018, 04:14:09 AM »
After a cursory check I think this may be the problem:
You are using a counter to access a selection set.
The initial value of the counter is 0 and you are counting up.
But in the while loop you are deleting entities from the set. This causes indices to shift.
Example: if you delete the ct=2 item from the set its place will be occupied by what was the ct=3 item. And ct=3 will find what was the ct=4 item.

Counting down instead of up may be the solution.
« Last Edit: July 13, 2018, 06:06:57 AM by roy_043 »

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Sorting Issue
« Reply #3 on: July 13, 2018, 11:31:43 AM »
Perhaps you should post an example of what fails to sort correctly.This keeps the reader form having to fully test your lisp.
As I said, I got that part fixed. It is now the placement of the text doesn't go in the upper right corner.

If I can duplicate it, I am going to try and post what happens, but so far I can't get it to do it again, so go ahead and ignore for now, sorry about that.
« Last Edit: July 13, 2018, 11:45:54 AM by cmwade77 »