added LSL2 stored procedures
This commit is contained in:
35
LSL2/STPROC/ARRAY_SORT.txt
Normal file
35
LSL2/STPROC/ARRAY_SORT.txt
Normal file
@ -0,0 +1,35 @@
|
||||
compile subroutine array_sort( Array, SortOrder, Justification )
|
||||
begin condition
|
||||
pre:
|
||||
post:
|
||||
end condition
|
||||
declare function fieldcount
|
||||
declare subroutine v119
|
||||
$insert logical
|
||||
|
||||
NumFields = fieldcount( Array, @fm )
|
||||
NumValues = fieldcount( Array<1>, @vm )
|
||||
|
||||
TmpSort = ''
|
||||
for k = 1 to NumValues
|
||||
Tvar = ''
|
||||
for j = 1 TO NumFields
|
||||
Tvar := Array<J,K>:@vm
|
||||
next j
|
||||
Tvar[-1,1] = ''
|
||||
TmpSort<K> = Tvar
|
||||
next k
|
||||
|
||||
convert @fm to @rm in TmpSort
|
||||
convert @vm to @fm in TmpSort
|
||||
TmpSort := @rm
|
||||
v119('S', '', SortOrder, Justification, TmpSort, '')
|
||||
convert @fm to @vm in TmpSort
|
||||
convert @rm to @fm in TmpSort
|
||||
TmpSort[-1,1] = ''
|
||||
for j = 1 to NumValues
|
||||
for k = 1 to NumFields
|
||||
Array<k,j> = TmpSort<j,k>
|
||||
next k
|
||||
next j
|
||||
|
Reference in New Issue
Block a user