Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running vbscripts in VB?

Status
Not open for further replies.

LordGarf

Programmer
Apr 13, 2005
34
BE
Hi,

Is it posible to when I create a visual basic program that can read in text files with pure vb code in it. Lets say functions calls to existing functions in the vb program.

so for example I have created a public SUB does_file_exists()
(this is pure an example)

so if I write in a textfile something like
call does_file_exists("c:\test.bmp")

then when my vb program runs it reads out the textfile and executes the call?

In other words is VB capable of interpretting its own code?

In PHP you have something like eval() wich is a function to execute PHP in PHP.

best regards
Garf.

tank you,

best regards,
Lord_Garfield
 
It is possible, but involves a certain amount of jumping though hoops; you might be better off with VBscript for this.
 
Can a vbscript call for an sub or function that is writtin in vb?

tank you,

best regards,
Lord_Garfield
 
As I said: it's possible. I've illustrated the AddObject technique discussed in the referenced thread on a number of occasions in this forum
 
Or just rewrite the VB program as VBScript in the first place, then use VBScript's Execute statement, ExecuteGlobal statement, or Eval() function as appropriate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top