Provides a base class for many other objects. All Objects working with Mini-Framework are required to inherit from MfObject.
All Object Classes in Mini-Framework derived from MfObject must call Base.__New() method if the are not-static classes. See Example Below.
Name |
Description |
|
Constructs a new instance of the class |
Name |
Description |
|
Adds MfAttribute extended items to extended classes |
||
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. |
||
Compares obj to current instance to see if they are the same |
||
Compares objA and objB to see if they are the same. If objA and objB are vars (non-object) then they are compared as strings |
||
Compares objA and objB to see if they are the same. If objA and objB are vars (non-object) then they are compared as strings or number depending on the value of CompareOpt. |
||
Gets an MfAttribute of the class. |
||
Gets a MfGenericList of MfAttribute that Contains the attributes for the current class instance |
||
Gets A hash code for the current MfObject. |
||
Gets the zero-based index value of the position of MfAttribute within the instance of the class. |
||
Gets the Type for the for the Class |
||
Gets if the current instance of class derived from MfSystemException has MfAttribute. |
||
Gets if current instance of object is of the same type |
||
Checks to see if obj is not an instance of MfObject. |
||
Checks to see if obj is not an instance specified by objType. |
||
Checks to see if obj is not an instance specified by objType. Optionally throws an error. |
||
Checks to see if obj is not an instance specified by objType. Optionally throws an error with the parameter name set. |
||
Get if the current class is an instance |
||
Gets if obj is a MfObject or derived class. All objects and/or classes that do not derive from MfObject will return false. |
||
Checks to see if obj is an instance of MfObject. |
||
Checks to see if obj is instance specified by objType. |
||
Creates a shallow copy of the current MfObject instance |
||
Determines whether the specified Object instances are the same instance. |
||
Gets a string representation of the MfObject. |
||
Verifies the the current object is set to an instance. |
||
VerifyIsNotInstance([MethodName, LineFile, LineNumber, Source]) |
Verifies the the current object is NOT set to an instance. Used in Static methods |
; Create a class the derives from MfObject
class Foo extends MfObject
{
m_FooMsg := ""
__New(msg) {
base.__New()
this.m_FooMsg := msg
}
GetFoo() {
if (this.IsInstance()) { ; check to see if class is actual instance
return this.m_FooMsg
}
return "Error: Not an instance"
}
}
Class Bar extends Foo
{
m_BarMsg := ""
__New(msgFoo, msgBar) {
base.__New(msgFoo)
this.m_BarMsg := msgBar
}
GetFooBar() {
if (this.IsInstance()) { ; check to see if class is actual instance
str := this.GetFoo() . ", " . this.m_BarMsg
return str
}
return "Error: Not an instance"
}
}
; example usage
MyFoo := new Foo("Hello World")
MsgBox % MyFoo.GetFoo() ; displays Hello World
MyBar := new Bar("Hello World", "have a nice day!")
MsgBox % MyBar.GetFoo() ; displays Hello World
MsgBox % MyBar.GetFooBar() ; displays Hello World, have a nice day!
; Type checking examples
MsgBox % MyBar.Is(Foo) ; displays 1 for true as Bar inherits foo
MsgBox % MyBar.Is(MfObject) ; displays 1 for true as Bar inherits foo and foo inherits MfObject
MsgBox % MyFoo.Is(MfObject) ; displays 1 for true as foo inherits MfObject
MsgBox % MyFoo.Is(Bar) ; displays 0 for false as foo does not inherit from bar
MsgBox % MyBar.Is(MyFoo.GetType()) ; Displays 1 for true