Category:Exprif BASIC
Contents |
Description
Exprif BASIC is a BASIC extension that is available on MSX Computer Magazine 46. You just need to enter RUN"EXPRIF" to install it.
It allows to use conditional expressions, just like in C language. It has the advantage to replace one or several lines with IF...GOTO...ELSE or IF...THEN...ELSE.
Besides, this extension allows to use assignments in expressions. In this case, you need to use LET, that can be forgotten in standard MSX-BASIC.
Examples
Example 1
10 IF A<10 THEN PRINT "Small" ELSE PRINT "Big"
becomes with Exprif BASIC
10 PRINT {A<10|"Small"|"Big"}
Example 2
10 IF B=0 THEN C=C+1 ELSE C=C*B
becomes with Exprif BASIC
10 C={B=0|C+1|C*B}
Example 3
10 A=0 20 A=A+1:IF A<100 THEN PRINT A:GOTO 20
becomes with Exprif BASIC
10 A=0 20 IF (LET A=A+1)<100 THEN PRINT A: GOTO 20
This category currently contains no pages or media.