Results 1 to 12 of 12

Thread: List of Commands

  1. #1

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180

    List of Commands

    Hi,

    I have an app which supplies a lot of commands, the user can enter in a textbox.

    For example:

    The user enters 'Mute sound', which is a valid command
    The how do I run the appropriate code?
    I don't want a Case statement sorting out the appropriate sub or code.
    I heard something about CallByName but I couldn't get it working here.
    Perhaps it is possible to put all these commands and there code in an external file and call them, sort like API calls.
    Could that be done?

    Thanx in advance for your help and time!

  2. #2
    Stiletto
    Guest
    Umm... God question... . whops gonna answer that?

  3. #3

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    Originally posted by Michael_Kamen
    Hi,

    I have an app which supplies a lot of commands, the user can enter in a textbox.

    For example:

    The user enters 'Mute sound', which is a valid command
    The how do I run the appropriate code?
    I don't want a Case statement sorting out the appropriate sub or code.
    I heard something about CallByName but I couldn't get it working here.
    Perhaps it is possible to put all these commands and there code in an external file and call them, sort like API calls.
    Could that be done?

    Thanx in advance for your help and time!
    I am making a chat program that uses command for just about everything the program can do. Are you saying you can't get your program to carry out the cammand you type in the textbox?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Of course I can execute them, I had a case statement.
    But if I have say over 50 commands that case gets a bit large.
    So I wondered if there's an other way to handle that.

  6. #6
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    just something to think about...

    you know, the users of you program may not want to memorize 50 text commands. you may want to give them a big dropdown menu / list or something. that way you can just use click events or whatever to execute the command code.

    if you do stick with the text thing, callbyname is the way to go, but it might take some time to play with...
    ______________

  7. #7

  8. #8

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Yes, Martin Liss, it works.
    Thank you very much, you've solved my problem.

    And thanks to the others for their thoughts!
    (y)

  9. #9

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    I had one more question about CallByName:

    Can I put the subs into a module or a class module, or do they have to be in the form?

  10. #10

  11. #11

  12. #12

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    That's too bad

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