array into array

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

array into array

Post by Silvio.Falconi »

I need to insert the data of an array into another but the first array data change each skip sample :

...
Local aDchk7:= {}
Local aData:= {}

while (!DO->(EOF()))

aData:= chk_ore( do->(RecNo()) , do->cognome, do->nome) // this give me an array with ten elements

aadd(aDchk7,{{ aData[1], aData[2],aData[3],aData[4],aData[5],aData[6],aData[7],aData[8],aData[9],aData[10] } })

do->(dbSkip())
enddo


the exe let me say this error

Error description: Error BASE/1132 Limiti superati: accesso all'array
Args:
[ 1] = A { ... } length: 1
[ 2] = N 2

I made also
aadd(aDchk7,{ aData[1], aData[2],aData[3],aData[4],aData[5],aData[6],aData[7],aData[8],aData[9],aData[10] }) ... same error
how I can resolve it ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: array into array

Post by driessen »

Sylvio,

Can you tell us what the chk_ore() function does? I got the idea that there is a problem in it.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: array into array

Post by James Bott »

I think this is wrong. It is giving you a two element array in the 2nd location of aDchk7:

aadd(aDchk7,{{ aData[1], aData[2],aData[3],aData[4],aData[5],aData[6],aData[7],aData[8],aData[9],aData[10] } })

Try it this way:

aadd(aDchk7, aData)

James
antolin
Posts: 475
Joined: Thu May 10, 2007 8:30 pm
Location: Sevilla

Re: array into array

Post by antolin »

Or only:

aadd(aDchk7,{ aData[1], aData[2],aData[3],aData[4],aData[5],aData[6],aData[7],aData[8],aData[9],aData[10] } )
Peaaaaaso de foro...
Post Reply