QBJS Swimming fish with Kelp
#17
(08-15-2023, 06:38 PM)dbox Wrote: The more I think about it the more inclined I am to change the way this is working in the next release of QBJS to increase compatibility with QB64.  I think instead of extending the array to also support associative arrays (dictionaries), I'll pull this functionality out into a new type called Dictionary.  Then I can implicitly convert any index values passed to an array to an integer, just as in QB64.
Actually, I take that back...  So as not to introduce a new keyword that could have other backwards compatibility challenges, I think I will just continue to use the array syntax.  However, if no sizing is specified (e.g.  dim lookup() As String) then I will assume it is an associative array (dictionary).  Otherwise, we'll assume it is a normal QBasic style array and implicitly convert the index values to integers.  This should make it more compatible in the future with examples like @bplus shared.

Here is what it looks like if you want to create a dictionary:
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: 8 Guest(s)