CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2000
    Location
    Upstate NY
    Posts
    249

    Adding Array Elements

    Is there a way to add array elements in a loop instead of like this.

    TotalDays = Days(1) + Days(2) + Days(3) + Days(4) + Days(5) + Days(6) + Days(7) + Days(8) + Days(9) + Days(10) + Days(11) + Days(12)

    Days of course is an array with the days number assigned in other parts of the program. A loop would be much neater.
    THANKS RSH


  2. #2
    Join Date
    Oct 2000
    Location
    Upstate NY
    Posts
    249

    Re: Adding Array Elements

    Dumb question

    For D = 1 To 12
    TotalDays = TotalDays + Days(D)
    Next D

    73 RSH


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured