Sorting content of array (AREV32)
At 09 AUG 2023 03:26:46AM CaRtman wrote:
Hi all,
I am trying to sort the array delimited with @FM alphabetically. In R/BASIC command reference I have found some example (doesn't make sence for me but I tried it):
LOCATE 'MEWS' IN CUST.REC<6> BY 'AL' USING @VM SETTING POS ELSE CUST.RECR=INSERT(CUST.REC,6,POS,0,'MEWS')
My code was:
vole="" pole="hovno,kokot,auto,debil,Olic" SWAP "," with @FM in pole ppole=count(pole,@FM)+1 debug for i = 1 to ppole slovo=pole<i> locate slovo in pole by 'AL' using @FM setting POS else pole=insert(pole,1,POS,0,slovo) next i
But obvisouly it didn't do anything. Is there any easier function like SORT(POLE, 'AL')?
Many thanks in advance
At 09 AUG 2023 03:38AM Andrew McAuley wrote:
Hi all,
I am trying to sort the array delimited with @FM alphabetically. In R/BASIC command reference I have found some example (doesn't make sence for me but I tried it):
LOCATE 'MEWS' IN CUST.REC<6> BY 'AL' USING @VM SETTING POS ELSE CUST.RECR=INSERT(CUST.REC,6,POS,0,'MEWS')
My code was:
vole="" pole="hovno,kokot,auto,debil,Olic" SWAP "," with @FM in pole ppole=count(pole,@FM)+1 debug for i = 1 to ppole slovo=pole<i> locate slovo in pole by 'AL' using @FM setting POS else pole=insert(pole,1,POS,0,slovo) next i
But obvisouly it didn't do anything. Is there any easier function like SORT(POLE, 'AL')?
Many thanks in advance
See docs for V119. To bubblesort like you were trying you’d start by locating in a new blank array
World leaders in all things RevSoft
At 09 AUG 2023 03:59AM CaRtman wrote:
Hi, thank you. V119 works well.
![]()