|
-
Mar 10th, 2002, 07:37 AM
#1
variables that point to other variables cause invalid qualifier (obviously), fixible?
variables that point to other variables cause invalid qualifier (obviously), fixible?
I have a class that holds some collections,
forsimplicity I will call them 1Coll, 2Coll, 3 Coll.
Ok
What I would like to do is circumnavigate the usual 'write 10 millions lines of cod which is exactly the same but for a different variable' situation
the situation is this:
each collection holds some data, I want to operate on the data according to user inputs
for example
UserInput = msgbox("enter a collection to use","a message", "1Coll")
for count = 1 to Userinput.count
tempvar = tempvar & UserInput.(count)
next count
the text in italics is what I want to specify a particular collection....
and I dont want reams of case statements in my class code, so is there a way round/to achieve this? there is in C++ cause you can assign pointers and stuff... I think this is what I need here
manythanks
Nit
__________________
Nit
-
Mar 10th, 2002, 07:54 PM
#2
Perhaps the CallByName function...?
-
Mar 12th, 2002, 09:07 PM
#3
Addicted Member
Why not also assign a string name to each collection. Then, when the users enters a string, you can search the collections for a match.
-
Mar 16th, 2002, 05:54 AM
#4
Thanks Joe for your reply
Your quite right, I can do it that way, but then later on if I create more class modules I will have to alter teh program classes as well... I want to be able just to add a module then use it with the main class, no additional hassel.
although if I also assign the string variables the value of the classes at runtime (is there a way of automatically detecting the classes in the project?) so that everytime teh prog runs it makes a list of classes it owns automatically....
this would be so much easier if inheritance worked properly in VB 
Nit
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
|