Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2213 Beta: String Sort
#1
wasnt there a string member 'Sort'?
one of my functions failed cuz it says 'sort' unknown member function.
An old blog on QM coding and automation.

The Macro Hook
#2
str.Sort
Code:
Copy      Help
function [flags] ;;flags: 1 z-a.

;Sorts lines.


if(!this.len) ret
str ss=this
ARRAY(lpstr) a
tok ss a -1 "[]" 1
int fa=iif(flags&1 &str_sortprocd &str_sortproc)
qsort &a[0] a.len sizeof(lpstr) fa
this=a
pi
#3
Removed it from samples2. Never use functions from samples2 in your macros. Make your copies. Sorry I did not warn before.

Now string sorting is like in the example in QM help, ARRAY.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)