|
-
October 24th, 2009, 10:53 AM
#1
modules within class
hi all again, is it possible to create a module within a class?
what i need is something like this:
public class form1
public sub i_nid_this_in_many_place()
end sub
end class
i couldn't inherit form1 with a class that had i_nid_this_in_many_place() because its devastatingly sad that form1 is already inherited
so i thought of this :
public class form1
end class
module cool
public sub i_nid_this_in_many_place()
end sub
end module
but this wouldn't work cause i_nid_this_in_many_place() needs to access a property of form1
this would work: (however that would make my module in other class useless)
public class form1
end class
module cool
public sub i_nid_this_in_many_place()
' form1.this_prop
end sub
end module
i could only think of this solution (passing form1 itself as an argument):
public class form1
' stuff
i_nid_this_in_many_place(me)
' and stuff
end class
module cool
public sub i_nid_this_in_many_place(byvar o as object)
' o.this_prop
end sub
end module
is there a more efficient way so that i do not have to include the object itself as an argument to my sub?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|