06-05-2023, 02:54 PM
(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".