Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: VBScript Eval() function - any way to do the same thing in VB?


Message #1 by "Mike Frazer" <mike@i...> on Mon, 10 Jun 2002 19:46:23
VBScript's Eval() function, much like the eval() functions in PHP and 
other languages, allows you to fead a line of standard text -- usually 
dynamic -- and treat it as code.  For instance, the following VBScript 
code:

Dim strCode, intValue

strCode = "CInt(85.33284)"     ' Basic string expression
intValue = Eval(strCode)       ' Evaluates the string as code


In this case, intValue would be assigned an integer value of 85.

Is there any way to do this in VB, short of referencing the VBScript DLL 
and using the function from there?  It's for use in a DLL and I don't 
really want to have it linked to 20 outside DLLs.

  Return to Index