Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple conditional sorting
#1
Hello, everyone

The following code is sorted in descending A-Z order

How to set the second condition?
Use the first number of the comment to do the second sort condition!

Any suggestions are welcome. Thanks in advance

For example: the result of the current code sorting is as follows

Code:
Copy      Help
ax :sub.Sub2 ;;4test
ax :sub.Sub3 ;;2test
ax :sub.Sub4 ;;3test
ax :sub.Sub5 ;;1test
cbc :sub.Sub6 ;;2test
cbc :sub.Sub7 ;;1test
zbc :sub.Sub1 ;;test1

I expect the results:
Code:
Copy      Help
ax :sub.Sub5 ;;1test
ax :sub.Sub3 ;;2test
ax :sub.Sub4 ;;3test
ax :sub.Sub2 ;;4test
cbc :sub.Sub7 ;;1test
cbc :sub.Sub6 ;;2test
zbc :sub.Sub1 ;;test1

Macro Macro3
Code:
Copy      Help
str s=
;cbc :sub.Sub7 ;;1test
;cbc :sub.Sub6 ;;2test
;ax :sub.Sub5 ;;1test
;ax :sub.Sub4 ;;3test
;ax :sub.Sub3 ;;2test
;ax :sub.Sub2 ;;4test
;zbc :sub.Sub1 ;;test1

ARRAY(str) a=s
a.sort(2)
s=a
mes s


Messages In This Thread
Multiple conditional sorting - by macman - 01-30-2021, 12:49 AM
RE: Multiple conditional sorting - by Kevin - 01-30-2021, 03:40 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)