Files
harbour-core/tests/and_or.prg
vszakats 9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00

45 lines
701 B
Plaintext

// Testing Harbour AND OR operators
PROCEDURE Main()
? "Testing logical shortcuts"
IF .F. .AND. DispAndReturnNIL() // and it should not break!
ENDIF
? "Testing .T. .T."
AndOr( .T., .T. )
? "Testing .T. .F."
AndOr( .T., .F. )
? "Testing .F. .F."
AndOr( .F., .F. )
? "Testing errors..."
AndOr( 1, .T. )
RETURN
FUNCTION DispAndReturnNIL()
? "this should not show!"
RETURN NIL
FUNCTION AndOr( lValue1, lValue2 )
IF lValue1 .AND. lValue2
? "They are both true"
ELSE
? "They are not both true"
ENDIF
IF lValue1 .OR. lValue2
? "At least one of them is true"
ELSE
? "None of them are true"
ENDIF
RETURN NIL