03-12-2023, 08:19 PM
(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.)