BAM: [new] _MAPSET and _MAPGET
#9
(03-12-2023, 06:55 PM)Petr Wrote: That's a nice job, filtering out strings like that. I just now read the definition of MapGet - what I wrote is only for numeric values. I don't know of a way to use a function that is supposed to return a string to return a number so that the string function gives a numeric output and other functions that expect a number accept this if I were to strictly follow the notation used. The same with MapSet - there both parameters would have to be written in quotation marks. The C language could do the above, but I can't serve there. Unfortunately, in QB64 you cannot write two functions with the same name so that one returns strings and the other with the same name returns numbers.

Yeah, BAM being a javascript-under-the-hood critter...

My mindset, from early training and throughout my career, has always been about strong typing.

Experiencing loose typing in BAM has me questioning much of what I've always been used to.  Kind of like having a slight identity crisis ...

Aside: I got into this _MAPSET and _MAPGET thing because I was at first wondering if a "swtich" function could be useful.  When I started thinking about the implementation of it, my mind wandered over to javascript maps, and my flickering-light-bulb-moment: switch function would be a javascript pain in the caboose to implement when I've got better things to do, but a global map and the statement+function will take me all of an hour.  (all in the context of giving ON GOSUB a new trick.)
Reply


Messages In This Thread
BAM: [new] _MAPSET and _MAPGET - by CharlieJV - 03-11-2023, 06:46 PM
RE: BAM: [new] _MAPSET and _MAPGET - by CharlieJV - 03-11-2023, 11:18 PM
RE: BAM: [new] _MAPSET and _MAPGET - by Petr - 03-12-2023, 10:41 AM
RE: BAM: [new] _MAPSET and _MAPGET - by CharlieJV - 03-12-2023, 04:16 PM
RE: BAM: [new] _MAPSET and _MAPGET - by CharlieJV - 03-12-2023, 04:28 PM
RE: BAM: [new] _MAPSET and _MAPGET - by Petr - 03-12-2023, 05:29 PM
RE: BAM: [new] _MAPSET and _MAPGET - by CharlieJV - 03-12-2023, 06:28 PM
RE: BAM: [new] _MAPSET and _MAPGET - by Petr - 03-12-2023, 06:55 PM
RE: BAM: [new] _MAPSET and _MAPGET - by CharlieJV - 03-12-2023, 08:19 PM



Users browsing this thread: 1 Guest(s)