I have to compose a string ("cStructure") by taking the products in an array and counting the same ones
the string must be made up of the Total of products + the third column product code
example :

the string must be "4LETT+1REGI"
I tried a test but not run ok, but return me only 4LETT and not 4LETT1REGI
Any solution ?
test
the string must be made up of the Total of products + the third column product code
example :

the string must be "4LETT+1REGI"
I tried a test but not run ok, but return me only 4LETT and not 4LETT1REGI
Any solution ?
test
#include "fivewin.ch"
Function test()
local aselezionati:={ { Â "01","Lettino","LETT",10,"images\servizi\lettino.png","",1,},;
     {  "01","Lettino","LETT",10,"images\servizi\lettino.png","",1,},;
     {  "01","Lettino","LETT",10,"images\servizi\lettino.png","",1,},;
     {  "01","Lettino","LETT",10,"images\servizi\lettino.png","",1,},;
     {  "03","Regista","REGI",10,"images\servizi\regista.png","",1,}   }
xbrowser aselezionati
    ?Compose(aselezionati)
return nil
//--------------------------------------------------------------------------------//
Function Compose(aselezionati)
local n
local cCodice:= ""
local nQuant:= 0
local cStructure:="" // THE STRING IS OF SPACE(15)
local k := 1
For n= 1 to Len(aselezionati)
IF !Empty(aselezionati[ n, 3 ]) .and.;
aselezionati[ n, 3 ]!=cCodice
do while k < Len( aselezionati )
if aselezionati[ k, 3 ] == cCodice
nQuant+=1
else
endif
k++
enddo
*
cStructure+=ltrim(str(nQuant))+cCodice
endif
cCodice:= aselezionati[ k, 3 ]
nQuant:= 0
*n++
// ? cStructure
Next n
return cStructureSince from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com