D
dwm
Is it possible to return a class from a function?
I would like to call a function and based on the result of the function
return the class that I want to use.
Thanks for any help!
Something like the following:
private class aClass1
private sub testSub()
debug.print "This is aClass1"
end sub
end class
private class aClass2
private sub testSub()
debug.print "This is aClass2"
end sub
end class
private class testClass()
private sub FormLoad
dim x as object?
x = myFunc() ' Is this possible?
x.testSub() ' Do I have to do some type of cast here?
end sub
private function myFunc() as someClass
if aGlobal = 1 then
return aClass1
else
return aClass2
end function
end class
I would like to call a function and based on the result of the function
return the class that I want to use.
Thanks for any help!
Something like the following:
private class aClass1
private sub testSub()
debug.print "This is aClass1"
end sub
end class
private class aClass2
private sub testSub()
debug.print "This is aClass2"
end sub
end class
private class testClass()
private sub FormLoad
dim x as object?
x = myFunc() ' Is this possible?
x.testSub() ' Do I have to do some type of cast here?
end sub
private function myFunc() as someClass
if aGlobal = 1 then
return aClass1
else
return aClass2
end function
end class