Results 1 to 6 of 6

Thread: Loading Variables as Functions/Modules

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    8

    Loading Variables as Functions/Modules

    Has anyone heard of a way, or even if it's possible to take a Variable, with VB code as the text, and have VB execute it as a function or sub?

    Or even maybe Write it to a Module.bas file and have it load and be usable at runtime?


    Example:
    public sub msgme(txt as string)
    msgbox "woo it works"
    end sub

    would be in a textbox, or a variable, And be able to be loaded up and executed as a subroutine?



    ~Shagz

  2. #2

  3. #3
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Actually, the first one may be possible using the MS Scripting Control, although it would probably be quite complex which is why it'd be easier to parse it (if it's simple enough, that is)
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    8
    I thought about the DLL approach, but I wouldn't be able to Write that during runtime, and be able to link it without rebuilding or restarting the App.

    The module.bas idea would have been convenient becuase of the way i can have the app write it out (as a text file with .bas extention), and then sorta somehow make the application load it up on command


    ~Shagz

  5. #5
    Lively Member
    Join Date
    Sep 2003
    Location
    USA
    Posts
    102
    You would be better off writing a program with the script control which will alow you to write and save scripts to seperate files. Then you write a dll to handle the loading and parsing of those script files.
    ===============
    Tek
    ===============

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    8
    Actually, I just tested out the MSscripting control.

    It's actually not bad. I can probably use this. Will more than likely have to put some work into it (since i've never used it before). But I can probably get something going with it.

    I'll just have it save the codeing inside it on app exit, and reload into it when app starts.

    Thanks guys =)

    ~Shagz

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