|
-
August 20th, 1999, 08:24 AM
#1
Do Until
Need a Solution for this.
Question is
Write a code segment to input and finding the sum and average of n numbers.
-
August 20th, 1999, 06:18 PM
#2
Re: Do Until
Either use Access or use a dat file. e-mail me if you want [email protected]
Genie Applebury
-
August 25th, 1999, 02:51 AM
#3
Re: Do Until
I hope this code snippet shows you how a Sum can be done:
''/
' This function recieves an array of Long's and summarizes them.
' It returns the sum of the numbers in the array, or zero (0) if
' The parameter is not an array of Long numnbers.
'/
public Function Summarize(byref MyNumberArray as Variant) as long
on error resume next
Dim result as Long ' Holds the sum
Dim l as Long ' Counter variable
result = 0
If VarName(MyNumberArray) = "Long()" then ' Certify that this is an array
for l = 0 to UBound(MyNumberArray)
result = result + MyNumberArray(l)
next
End If
Summarize = result
End Function
P.Dias
Oslo, Norway
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|