08-15-2023, 02:41 PM
(08-15-2023, 01:23 PM)dbox Wrote: Not pestering at all @bplus, happy to help!
What I changed to get the kelp working was to add a call to Fix() to force some of those values to integers when accessing or setting array values. QBJS is a bit more flexible with values that can be passed to arrays. So, it doesn't explicitly convert floating point numbers to integers when they are passed in as an array index. This is in part so it can natively support associative arrays (dictionaries). You can see more about this in QBJS Fun Fact #3.
@dbox Eeeh! I thought things would get "fixed" automatically because the Kelp array has the _Unsigned Long Type = only positive integers.
ReDim Shared kelp(sw, sh) As _Unsigned Long
wait this FIX was needed???
r = Fix(Int(Rnd * 23) + 1)
why doesn't INT alone fix it? You have to FIX a number already made integer?
hmm.. the +1 is + .99999 or 1.000001 ie float?
Sorry don't mean to be argumentative but I remember things better if they make sense to me.
b = b + ...