justplainsoccer Posted December 4, 2003 Posted December 4, 2003 i'll first show u the code then try to explain my situation Select Case MainControl.SelectedIndex Case 0 collectionStr = "keyCol" Case 1 collectionStr = "accCol" Case 2 collectionStr = "denyCol" End Select ModifyCertainCollectionInSomeWay(collectionStr) then in the ModifyCertainCollectionInSomeWay i want it to modify that collection in some way... get what im tryin to say? Quote
bpayne111 Posted December 5, 2003 Posted December 5, 2003 when you say 'certain collection' do you mean there are different collection objects and you'd like to choose which one during runtime? if so simply pass that collection as a parameter as well... you can even do it byval because it's a complex object. i think that's what you are trying to say. are these collections different types? Are you using methods from CollectionBase? or your own? try adding a parameter that is a CollectionBase. if you are dealing with some custom property, i THINK you can convert back to the first type using a try catch and nested if (i'm pretty sure this is polymorphism at work, i hope i am correct in that ) i hope that helps Quote i'm not lazy i'm just resting before i get tired.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.