MfBool

Namespace ›› System ››
Parent Previous Next

MfBool Class

(Inherits from MfPrimitive)

Represents Boolean object for handling true and false values.

Links

Fields, Properties, Methods, Example

Constructors


Name

Description

Constructor([val, retunAsObj, readonly])

Initializes a new instance of the MfBool class optionally setting the Value property, ReturnAsObject property and Readonly Property.

Fields


Name

Description

False

Get a var of representing False.

FalseString

Get a string var representing False

True

Gets a var value representing True

TrueString

Get a string var representing True.

Properties


Name

Description

FalseObj

Gets a new instances of MfBool with its Value property set to False.

IsFalse

Gets if the Value associated with the this instance of MfBool is false.

IsTrue

Gets if the Value associated with the this instance of MfBool is true.

ReadOnly

Gets the if the derived class will allow the underlying value to be altered after the constructor has been called. Inherited from MfPrimitive

ReturnAsObject

Gets or sets the if the class will return objects as their return value for various functions

TrueObj

Gets a new instances of MfBool with its Value property set to True.

Value

Gets or sets the value associated with the class. Overrides MfPrimitive.Value.

Methods


Name

Description

CompareTo(obj)

Compares this instance to a specified MfBool object. Overrides MfObject.CompareTo()

Equals(value)

Gets if this instance Value is the same as the value. Overrides MfObject.Equals()

GetHashCode()

Gets A hash code for the current MfBool. Overrides MfObject.GetHashCode()

GetType()

Gets the Type for the for the Class .Inherited from MfObject.

GetValue(Obj)

Gets the boolean var from Object or var containing boolean. Overrides MfPrimitive.GetValue()

GetValue(Obj, Default)

Gets a boolean var from Obj or returns Default value if Obj is unable to be converted to boolean. Default must be a value that can be converted to boolean or it will be ignored if Obj can not be converted to boolean and an error will be thrown. Overrides MfPrimitive.GetValue()

GetValue(Obj, Default, AllowAny)

Gets a boolean var from Obj or returns Default value if Obj is unable to be converted to boolean.Default can be not boolean if AllowAny is true. Overrides MfPrimitive.GetValue()

Is(ObjType)

Gets if current instance of MfBool is of the same type as ObjType or derived from ObjType. Overrides MfObject.Is().

IsInstance()

Get if the current class is an instance. Inherited from MfObject.

MemberwiseClone()

Creates a shallow copy of the current MfObject instance. Inherited from MfObject.

Parse(obj)

Converts the specified string representation of a logical value to its Boolean equivalent, or throws an exception if the string is not equal to the value of TrueString or FalseString.

ToString()

Gets a string representation of the Value of the object. Overrides MfPrimitive.ToString()

TryParse(byref bool, obj)

Tries to convert the specified string representation of a logical value to its Boolean equivalent. A return value indicates whether the conversion succeeded or failed.
The conversion fails if the obj parameter is null, or is not equal to the value of either the TrueString or FalseString field.

Example

UserInput := Mfunc.InputBox("Question!", "Programming is cool (true or false)", , 300, 140)
if (ErrorLevel)
{
   MsgBox, CANCEL was pressed.
}
else
{
   try
   {
       bValue := new MfBool(MfBool.GetValue(UserInput))
       if (bValue.IsTrue)
       {
           MsgBox, 64, Agreed, I agree!
       }
       else
       {
           MsgBox, 64, Artistic!, Maybe you would enjoy something a little more artistic.
       }
   }
   catch
   {
       MsgBox, 16, Bad Input, The input was not acceptable.
   }
}