Sum Of an Array

Results 1 to 2 of 2

Thread: Sum Of an Array

  1. #1
    Join Date
    Dec 1969

    Default Sum Of an Array

    Hi<BR><BR>Is it possible to sum an array..<BR><BR>fx is I have an array with following data<BR><BR>Testarray(&#039;Jojo&#039;,2)<BR>Testa rray(&#039;Jijo&#039;,4)<BR><BR>Can I sum the last colum ?? So I get 6 ?<BR><BR>Thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Sum Of an Array

    Try this:<BR><BR>lowcount=lbound(Testarray)<BR>highcou nt=ubound(Testarray)<BR>sumcount=0<BR><BR>for counter=lowcount to highcount<BR> sumcount = sumcount + Testarray(counter,2)<BR>next<BR><BR>Response.write "Sum of Array: " & sumcount<BR><BR>---<BR><BR>Not sure if the counter,2 is correct...should get you close though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts