OutputVar := instance.ToStringList()
Gets a MfGenericList of MfString of the different types in the collection.
Returns a MfGenericList of MfString
; Example function
MyFunc(args*) {
; check to see if the first arg is in instance of MfPrams and use if it is
; args is 1 base index
if (MfObject.IsObjInstance(args[1], MfParams))
{
pArgs := args[1] ; arg 1 is a MfParams object so we will use it
}
else
{
; Mfparams was not passed in so we will create an instance and add all the args
pArgs := new MfParams()
for index, arg in args
{
pArgs.Add(arg)
}
}
; this method only takes 1 to 3 arguments so we will check and throw an error if wrong number of args
if ((pArgs.Count < 1) || (pArgs.Count > 3)) {
eMsg := MfEnvironment.Instance.GetResourceString("NotSupportedException_MethodOverload")
e := new MfNotSupportedException(eMsg)
e.SetProp(A_LineFile, A_LineFile, A_ThisFunc)
throw e
}
_byte := 0
_returnAsObject := false
_readonly := false
pList := pArgs.ToStringList()
s := Null
pIndex := 0
if (pList.Count > 0)
{
s := pList.Item[pIndex].Value
if ((s = "MfInteger")
|| (s = "MfInt64")
|| (s = "MfByte"))
{
_byte := pArgs.Item[pIndex].Value
if ((_byte < MfByte.MinValue) || (_byte > MfByte.MaxValue))
{
ex := new MfArgumentOutOfRangeException("byte"
, MfEnvironment.Instance.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"
, MfByte.MinValue, MfByte.MaxValue))
ex.SetProp(A_LineFile, A_LineFile, A_ThisFunc)
throw ex
}
}
else
{
tErr := _ErrorCheckParameter(pIndex, pArgs)
if (tErr)
{
tErr.SetProp(A_LineFile, A_LineFile, A_ThisFunc)
Throw tErr
}
}
}
if (pList.Count > 1)
{
pIndex++
s := pList.Item[pIndex].Value
if (s = "MfBool")
{
_returnAsObject := pArgs.Item[pIndex].Value
}
else
{
tErr := _ErrorCheckParameter(pIndex, pArgs)
if (tErr)
{
tErr.SetProp(A_LineFile, A_LineFile, A_ThisFunc)
Throw tErr
}
}
}
if (pList.Count > 2)
{
pIndex++
s := pList.Item[pIndex].Value
if (s = "MfBool")
{
_readonly := pArgs.Item[pIndex].Value
}
else
{
tErr := _ErrorCheckParameter(pIndex, pArgs)
if (tErr)
{
tErr.SetProp(A_LineFile, A_LineFile, A_ThisFunc)
Throw tErr
}
}
}
; other code here ...
}
_ErrorCheckParameter(index, pArgs, AllowUndefined = true) {
ThrowErr := False
if((!IsObject(pArgs.Item[index])) && (pArgs.Item[index] = Undefined))
{
if (AllowUndefined = true)
{
return False
}
ThrowErr := new MfArgumentException(MfEnvironment.Instance.GetResourceString("Argument_Error_on_nth"
, (index + 1)))
ThrowErr.SetProp(A_LineFile, A_LineFile, A_ThisFunc)
return ThrowErr
}
ThrowErr := new new MfArgumentException(MfEnvironment.Instance.GetResourceString("Argument_Error_on_nth"
, (index + 1)))
ThrowErr.SetProp(A_LineFile, A_LineFile, A_ThisFunc)
return ThrowErr
}