HOLA
PERDON POR MI IGNORANCIA
TENGO UN ARRAY [n,13]
¿ COMO HAGO UN "SUM" DE TODOS LOS CAMPOS [n,1 ... 13] ?
¿ DEBE SER CON UN FOR - NEXT ?
¿ PODRIAN MOSTRARME UN EJEMPLO DE COMO HACER LA FUNCION ?
POR SU COMPRENSION
GRACIAS
DANIEL PECHIR TAGER
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Operaciones con Arrays
-
- Mensajes: 192
- Registrado: Vie Mar 15, 2013 12:32 am
Re: Operaciones con Arrays
Qué tal!
Podría ser con for next o for each
Te podrían servir estas guías. http://www.kresin.ru/en/hrbfaq_3.html y https://en.wikipedia.org/wiki/Harbour_(software)
Saludos
Podría ser con for next o for each
Código: Seleccionar todo
FUNCTION nSumaArrayForNext(aVariable)
Local nIndice, nSuma:=0
for nIndice:= 1 to Len( aVariable)
nSuma+=aVariable[nIndice]
end
RETURN nSuma
FUNCTION nSumaArrayForEach(aVariable)
Local nElemento, nSuma:=0
for each nElemento in aVariable
nSuma+=nElemento
end
RETURN nSuma
Saludos
-
- Mensajes: 192
- Registrado: Vie Mar 15, 2013 12:32 am
Re: Operaciones con Arrays
AVITALINI: GRACIAS POR TU AYUDA
DANIEL
DANIEL