Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
42
Task/Boolean-values/FutureBasic/boolean-values-3.basic
Normal file
42
Task/Boolean-values/FutureBasic/boolean-values-3.basic
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
void local fn BooleanExercise
|
||||
BOOL areEqual = (1 == 1) // areEqual is YES
|
||||
BOOL areNotEqual = not areEqual /* areNotEqual is converted to: areEqual = (-(1 == 1)). -1 throws a clang warning.
|
||||
NOTE: FB does not accept the "!" shorthand for "not", i.e. !areEqual, common in other languages. */
|
||||
|
||||
print "areEqual == "; areEqual
|
||||
print "areNotEqual == "; areNotEqual
|
||||
print
|
||||
|
||||
// Boolean types assigned values outside YES or NO compile without complaint.
|
||||
boolean minusOneTest = -1
|
||||
print "minusOneTest == "; minusOneTest
|
||||
|
||||
// Typical boolean value is use
|
||||
BOOL flatterRosettaReader = YES
|
||||
if (flatterRosettaReader)
|
||||
print
|
||||
print @"Rosetta Code programmers understand booleans."
|
||||
print
|
||||
end if
|
||||
|
||||
// Defined Core Foundation boolean values
|
||||
print "kCFBooleanTrue == "; kCFBooleanTrue
|
||||
print "kCFBooleanFalse == "; kCFBooleanFalse
|
||||
print
|
||||
|
||||
// Number object assigned literal value
|
||||
CFNumberRef booleanObject = @(YES)
|
||||
print "booleanObject == "; booleanObject
|
||||
print
|
||||
|
||||
// Number object created programmatically
|
||||
booleanObject = NO
|
||||
print "booleanObject variable reassigned as N0 == "; fn NumberWithBool( booleanObject )
|
||||
print
|
||||
end fn
|
||||
|
||||
window 1
|
||||
|
||||
fn BooleanExercise
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue