comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Adding arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Adding arrays [message #91468 is a reply to message #91465] Fri, 17 July 2015 02:26 Go to previous messageGo to previous message
Nikola is currently offline  Nikola
Messages: 53
Registered: November 2009
Member
On Friday, July 17, 2015 at 8:39:01 AM UTC+1, Dete van Eeden wrote:
> Hallo,
>
> I am trying to add arrays together in a for loop but the end result is just equal to the last array.
>
> for k=0,5 do begin
>
> read in the array etc.
>
> final = final + array
>
> endfor
>
> The final is suppose to be the sum of all the arrays.
>
> Thank you!

You somehow overwrite your variable f within the loop (if f is reset to 0 for every k, the final result is clearly just the last element). If it is not obvious, perhaps it's in a subfunction that your calling in the loop?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: creating arrays in loops
Next Topic: Creating KML error

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:40:40 PDT 2025

Total time taken to generate the page: 0.00508 seconds