06-05-2023, 03:27 PM
(06-05-2023, 02:54 PM)mnrvovrfc Wrote:(06-03-2023, 10:59 PM)CharlieJV Wrote: BAM programs being interpreted by javascript (i.e. wwwbasic.js, significantly modified), it took me all of 10 minutes to just go ahead and setup an IFF function.
Although not very BASIC-like, (javascript not being strongly typed) the IFF function works as-is for both strings and whatever numbers (so I'm kind of appreciating the no fuss no muss compactness).
The Javascript version should work for any type including user-defined types, those that could have methods or not, but to assign values to the "properties". In QB64 one would have to write a new "IFF" function for each user-defined type, along the lines of my demonstration. Even if it involves a mere assignment such as "firstrecord = secondrecord".
Just to be clear, BAM, although allowing some things to not be strongly typed (numeric vs string), BAM only allows standard types.
This IFF in BAM will only work with primitive types (string, integer, floating point).
BAM programs do not allow embedded javascript. Only BASIC things that are recognized by the interpreter.