16 lines
453 B
Plaintext
16 lines
453 B
Plaintext
!True BASIC maneja correctamente las expresiones booleanas,
|
|
!Pero no tiene un tipo booleano.
|
|
|
|
!La solución: crear constantes False y True y usarlas según sea necesario."
|
|
LET False = 0
|
|
LET True = 1
|
|
PRINT True; ", "; False
|
|
|
|
IF True = 0 THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
|
IF True > False THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
|
|
|
!Para el operador NOT, los paréntesis rodean la cláusula completa.
|
|
IF Not(2 < 1) then PRINT "TRUE" ELSE PRINT "FALSE"
|
|
|
|
END
|