Page 1 of 1

array into array

Posted: Mon Feb 23, 2015 4:50 pm
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 ?

Re: array into array

Posted: Tue Feb 24, 2015 11:07 pm
by driessen
Sylvio,

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

Re: array into array

Posted: Tue Feb 24, 2015 11:41 pm
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

Re: array into array

Posted: Sun Mar 08, 2015 11:15 am
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] } )