06-05-2023, 05:26 PM
(06-05-2023, 05:15 PM)bplus Wrote:(06-05-2023, 05:06 PM)CharlieJV Wrote:OK not javascript crap ;-))(06-05-2023, 05:01 PM)bplus Wrote: Hi Charlie, could you show me a quick copy of BAM code for IFF? or are you using some Javascript jazz?
BAM does not do javascript, and I can't ever see me allowing BAM to do javascript. New BASIC statements/functions that might not exist in other BASIC implementations, and often non-strict typing, but no javascript crap.
I was just wondering how you have IFF( ) coded for BAM, interesting that it allows both string and I assume numeric expressions for first parameter.
Nevermind, I guess you went over all this at beginning of thread. I was surprised BAM not sticking strictly to types.
Well, making changes/additions to the interpreter (wwwBASIC.js), that is all javascript crap all the time. Drives me insane, but gotta deal with the pain to get this browser-based BASIC juuuuuust right.
The javascript code to implement IIF:
Code: (Select All)
if (name=='iff') {
Skip('(');
var a = Expression();
Skip(',');
var b = Expression();
Skip(',');
var c = Expression();
Skip(')');
return '('+ a + ' ? ' + b + ' : ' + c + ')';
}