Some array functions via the rx plugin #385
Peter-Jacob
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I converted some of my BREXX array (non-stem) functions to the new CREXX plugin feature.
shell_sort(array,sort-offset,sort-order) sorts an array/stem
array array to sort. The sort algorithm is SHELL sort, it is the simplest non-recursive method
sort-offset sort position e.g. 1 beginning of the record, 10 sort from column 10
sort-order ASC/DESC ascending/descending
reverse_array(array)
reverses the array content, first element becomes last, last the first, etc.
search_array(array,needle,startrow) search a string in the array
array array to search.
needle search string
startrow row to begin the search
returns the index where the item was found, or zero if it was not found
delete_array(array,startrow,torow) Deletes array items within the range of startrow and endrow
array array used for delete.
startrow start row where delete begins
endrow last row to be deleted
every row between startrow and endrow will be removed. This means the array shrinks as the entries are gone
insert_array(array,startrow,newrows) adds new rows at startrow, existing rows will be moved accordingly
array array to expand
startrow start row where the first row will be inserted
newrows number of rows to be inserted
the function only creates space for new entries, the content must be set separately.
copy_array(source-array,new-array,startrow,endrow) copies full or partial array to new array
source-array array to copy
new-array receiving array
startrow first row which will be copied
endrow last row to be copied
merge_array(source-array,array-2) merges array2 into source-array, boths array must be sorted in thee same way
source-array receiving the array
array-2 array which is merged into source-array
list_array(source-array,startrow,endrow) lists full or partial array
source-array array to be listed
startrow first row which will be listed
endrow last row to be listed
The performance is excellent! Naming can be discussed!
Beta Was this translation helpful? Give feedback.
All reactions