QBJS Swimming fish with Kelp
#7
(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 + ...
Reply


Messages In This Thread
QBJS Swimming fish with Kelp - by bplus - 08-15-2023, 02:37 AM
RE: QBJS Swimming fish with Kelp - by dbox - 08-15-2023, 12:06 PM
RE: QBJS Swimming fish with Kelp - by bplus - 08-15-2023, 12:19 PM
RE: QBJS Swimming fish with Kelp - by dbox - 08-15-2023, 12:53 PM
RE: QBJS Swimming fish with Kelp - by bplus - 08-15-2023, 01:07 PM
RE: QBJS Swimming fish with Kelp - by dbox - 08-15-2023, 01:23 PM
RE: QBJS Swimming fish with Kelp - by bplus - 08-15-2023, 02:41 PM
RE: QBJS Swimming fish with Kelp - by dbox - 08-15-2023, 04:27 PM
RE: QBJS Swimming fish with Kelp - by CharlieJV - 08-15-2023, 05:01 PM
RE: QBJS Swimming fish with Kelp - by dbox - 08-15-2023, 06:38 PM
RE: QBJS Swimming fish with Kelp - by dbox - 08-17-2023, 04:54 PM
RE: QBJS Swimming fish with Kelp - by grymmjack - 08-17-2023, 12:00 AM
RE: QBJS Swimming fish with Kelp - by CharlieJV - 08-18-2023, 11:24 PM
RE: QBJS Swimming fish with Kelp - by grymmjack - 08-17-2023, 12:06 AM
RE: QBJS Swimming fish with Kelp - by bplus - 08-17-2023, 12:14 AM
RE: QBJS Swimming fish with Kelp - by grymmjack - 08-17-2023, 01:20 AM
RE: QBJS Swimming fish with Kelp - by animegame - 08-18-2023, 06:51 PM
RE: QBJS Swimming fish with Kelp - by grymmjack - 08-17-2023, 01:21 AM
RE: QBJS Swimming fish with Kelp - by bplus - 08-17-2023, 07:52 AM
RE: QBJS Swimming fish with Kelp - by bplus - 08-18-2023, 07:50 PM
RE: QBJS Swimming fish with Kelp - by vince - 08-28-2023, 12:43 PM



Users browsing this thread: 6 Guest(s)