Solved

How do I SUM the values in a LotusScript integer array?

Posted on 2000-05-04
3
1,024 Views
Last Modified: 2013-12-18
I have a non-dynamic LotusScript array of integer values and I want to SUM.  I understand that I need to loop through the array (ForAll?) and sum the values in each array element, but I'm not quite sure how to do it.  Need help FAST!  =)

Thanks, Chad
0
Comment
Question by:chad_wessel
  • 2
3 Comments
 
LVL 6

Expert Comment

by:ghassan99
ID: 2777171
Dim values(5) As Integer
Dim x,y As Integer

values(0) = 25
values(1) = 20
values(2) = 15
values(3) = 10
values(4) = 5

y = 0

For x=0 to 4
   y = y + values(x)
End For

y has the total value of all the elements of the array.

-Gus
0
 
LVL 6

Accepted Solution

by:
ghassan99 earned 200 total points
ID: 2777178
If you want to use ForAll:

ForAll x in values
   y = y + x
End ForAll

-Gus
0
 

Author Comment

by:chad_wessel
ID: 2778031
thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question