|
|
|
|
|
| | |
|
Active Server Pages ASP a directory of ASP tutorials applications scripts components and articles for the novice to professional developer. CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
add up array elements |
From: |
witold |
Date: |
5/21/2002 10:43:34 AM |
IP: |
217.8.168.228 |
hi, i need to sum up all elements in my array.
below there's a code i use.
somehow the total value is always equal to the last element
MySplitArray = (1, 2, 3)
for i=0 to UBound(MySplitArray)
response.write MySplitArray(i) & "<br>"
subTotal = 0
Total = subTotal + MySplitArray(i)
Next
Each time i run the code the result is "3" and should be "6". any idea what i do wrong?
witold |
Follow Up - Re: add up array elements - Jay 5/23/2002 5:35:54 PM
|
|
|
|
|
|
|
|
|
|
|
|