Boolean values: Difference between revisions
Content deleted Content added
m Undo revision 312633 by Dick de Bill (talk) |
|||
Line 1,871: | Line 1,871: | ||
>>> bool("False") |
>>> bool("False") |
||
True</lang> |
True</lang> |
||
=={{header|QBasic}}== |
|||
QBasic, QuickBASIC, VB-DOS and GW-BASIC doesn't have a Boolean type. What it does is to take 0 as False, and any other value as True. The easiest way in QBASIC, QuickBASIC and VB-DOS is to create False and True constants of type Integer and, then, use them as needed: |
|||
<lang QBASIC> |
|||
CONST FALSE=0 |
|||
CONST TRUE = Not FALSE |
|||
Print FALSE |
|||
Print TRUE |
|||
</Lang> |
|||
In GW-BASIC you can create a variable called FALSE% and other called TRUE% and do the same. Nevertheless, is more sure to create functions in order to avoid the value to be manipulated: |
|||
<lang QBASIC> |
|||
10 DEF FNFALSE = 0 |
|||
20 DEF FNTRUE = NOT FNFALSE |
|||
30 Print FNFALSE |
|||
40 Print NFTRUE |
|||
</Lang> |
|||
=={{header|R}}== |
=={{header|R}}== |