home *** CD-ROM | disk | FTP | other *** search
- **
- ** PROGRAM TITLE : BOOLEAN
- **
- ** WRITTEN BY : Paul Long
- **
- ** WRITTEN FOR : Copyright (C) 1992 All rights reserved. XL Systems, Inc.
- **
- ** PROGRAM INTENT: Boolean (true/false) class
- **
- #include "oclip.ch"
-
-
- // Simple low-level class for boolean objects
- CLASS Boolean
- VAR lWhether // The "value" of the object (.t./.f.)
- METHOD New = BooleanNew // Constructor
- METHOD Destruct = BooleanDestruct // Destructor
- METHOD Value = BooleanValue // Put and get boolean value
- ENDCLASS
-
-
- *******************************************************
- *
- * BooleanNew
- *
- *******************************************************
- * Construct Boolean object. If no value given, defaults to .f.
- *
- METHOD FUNCTION BooleanNew(lInitialValue)
-
- ::Value(if(lInitialValue == nil, .f., lInitialValue))
-
- return Self
-
-
- *******************************************************
- *
- * BooleanDestruct
- *
- *******************************************************
- * Destruct Boolean object. (no-op)
- *
- METHOD FUNCTION BooleanDestruct
-
- return nil
-
-
- *******************************************************
- *
- * BooleanValue
- *
- *******************************************************
- * Return whether last search succeeded. If argument is provided, set
- * instance variable to that value. Regardless, return the current value.
- * Note: lWhether is different than ::lWhether.
- *
- METHOD FUNCTION BooleanValue(lWhether)
-
- if lWhether != nil
- ::lWhether := lWhether
- endif
-
- return ::lWhether
-