home *** CD-ROM | disk | FTP | other *** search
- compile if EVERSION < '5.60'
- Error: SORTEPM.E (SORT_TYPE = 'EPM') can only be used with EPM 5.60 or above.
- compile endif
-
- defproc sort(firstline, lastline, firstcol, lastcol, fileid)
- Revers=not verify('R',upcase(arg(6))) + 2*(not verify('I',upcase(arg(6)))) + 4*(not verify('C',upcase(arg(6))))
- compile if EPM32
- return dynalink32(E_DLL, 'EtkSort',
- gethwndc(5) || atol(fileid) ||
- atol(firstline) || atol(lastline) ||
- atol(firstcol) || atol(lastcol) ||
- atol(Revers),
- 2)
- compile else
- return dynalinkc( E_DLL, '_EtkSort', /* function name */
- gethwndc(5) || atol(fileid) ||
- atol(firstline) || atol(lastline) ||
- atoi(firstcol) || atoi(lastcol) ||
- atol(Revers),
- 2);
- compile endif
-
- defc sort =
- if browse() then
- sayerror BROWSE_IS__MSG ON__MSG
- return
- endif
- TypeMark=marktype()
- if TypeMark='' then /* if no mark, default to entire file */
- getfileid fileid
- firstline=1 ; lastline=.last ; firstcol=1; lastcol = 40
- else
- getmark firstline, lastline, firstcol, lastcol, fileid
- /* If it was a line mark, the LastCol value can be 255. Can't */
- /* imagine anyone needing a key longer than 40. */
- if TypeMark='LINE' then lastcol=40 endif
- endif
-
- sayerror SORTING__MSG lastline-firstline+1 LINES__MSG'...'
-
- /* Pass the sort switches "rc", if any, as a sixth argument to sort(). */
- result = sort(firstline, lastline, firstcol, lastcol, fileid, arg(1) )
- if result then
- sayerror 'SORT' ERROR_NUMBER__MSG result
- else
- sayerror 0
- endif
-
-