Results 1 to 4 of 4

Thread: variables that point to other variables cause invalid qualifier (obviously), fixible?

  1. #1
    Nit
    Guest

    Unhappy 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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Perhaps the CallByName function...?

  3. #3
    Addicted Member
    Join Date
    Jul 2001
    Posts
    133
    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.

  4. #4
    Nit
    Guest
    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
  •  



Click Here to Expand Forum to Full Width