Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
suggestion: initialize array values within the DIM statement
#10
(12-21-2022, 07:01 PM)Pete Wrote: Well, I don't see a function, because we are returning a set of array values, not just a single value; so a sub seems a more likely choice...

You should do your loop from 0 to 4, not 1 to 5 because you started an array at subscript zero...

Also the subprogram that you wrote doesn't initialize the array at subscript zero, it just increases local "i" by one. Then its value is one at first pass.

Even better (in main program) do:

Code: (Select All)
FOR i = LBOUND(LNUMS) to UBOUND(LNUMS)
Reply


Messages In This Thread
RE: suggestion: initialize array values within the DIM statement - by mnrvovrfc - 12-21-2022, 07:40 PM



Users browsing this thread: 3 Guest(s)