Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,34 @@
|
|||
uses generics 'containing sort macros
|
||||
uses console
|
||||
string sdata={"CC","Aa","aAa","bb","bbB","b","B","c","A"}
|
||||
'
|
||||
int count = countof sdata
|
||||
'
|
||||
macro filter(f,a)
|
||||
=================
|
||||
'sdata[a]
|
||||
f=1 'allow all
|
||||
end macro
|
||||
'
|
||||
macro compare(f,a,b)
|
||||
====================
|
||||
int la=len sdata[a]
|
||||
int lb=len sdata[b]
|
||||
if la<lb
|
||||
f=1 'descending length
|
||||
elseif la>lb
|
||||
'
|
||||
elseif ucase(sdata[a])>ucase(sdata[b])
|
||||
f=1 'ascending but case insensitive
|
||||
endif
|
||||
end macro
|
||||
'
|
||||
NewSortIndex(index,count,rcount,filter,compare)
|
||||
NewSortedData(sorted,sdata,index,rcount)
|
||||
'
|
||||
print "Count: " rcount cr cr
|
||||
int i
|
||||
for i=1 to rcount
|
||||
print sorted[i] cr
|
||||
next
|
||||
pause
|
||||
Loading…
Add table
Add a link
Reference in a new issue