|
-
Oct 12th, 2003, 04:25 PM
#1
Thread Starter
New Member
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
-
Oct 12th, 2003, 05:06 PM
#2
The first isn't possible. The second is a dll.
-
Oct 12th, 2003, 05:12 PM
#3
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.
-
Oct 12th, 2003, 05:13 PM
#4
Thread Starter
New Member
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
-
Oct 12th, 2003, 05:23 PM
#5
Lively Member
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
===============
-
Oct 12th, 2003, 05:54 PM
#6
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|