12-21-2022, 07:40 PM
(This post was last modified: 12-21-2022, 07:42 PM by mnrvovrfc.
Edit Reason: Wanted to be correct about what I typed here earlier
)
(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)