Looking for a VB function like Eval() in ASP or Interpret in REXX 
Author Message
 Looking for a VB function like Eval() in ASP or Interpret in REXX

Hi.

I am looking for a VB function which  allows you to assign a value to a
existing variable by executing a string expression.

Example: I have a field called nLength, nWidth  in table called tblDefaults.
(nLength=5, nWidth=3)

In VB:
    Dim nAdd as Integer
    Dim nMultiple as Integer

    oRecSet =  "Select  nLength, nWidth  from tblDefaults"

    If not oRecSet.eof then
        nAdd = VBFunction( nLength & " + "  & nWidth)             ( nAdd=8 )
        nMultiple = VBFunction( nLength & " * "  & nWidth)        (
nAdd=15 )

    End if

Thanks, Russell



Fri, 25 Jun 2004 21:34:20 GMT  
 Looking for a VB function like Eval() in ASP or Interpret in REXX
I believe you have to use the eval function in jscript.net, as vb.net dont
have one,  Easiest way is to create a simple wrapper DLL to the eval method
in a single jscript class and use that from vb.

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional Windows Forms
     ISBN: 1861005547
Professional JSP
    ISBN: 1861003625
Beginning JSP Web Development
    ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------


Quote:
> Hi.

> I am looking for a VB function which  allows you to assign a value to a
> existing variable by executing a string expression.

> Example: I have a field called nLength, nWidth  in table called
tblDefaults.
> (nLength=5, nWidth=3)

> In VB:
>     Dim nAdd as Integer
>     Dim nMultiple as Integer

>     oRecSet =  "Select  nLength, nWidth  from tblDefaults"

>     If not oRecSet.eof then
>         nAdd = VBFunction( nLength & " + "  & nWidth)             (
nAdd=8 )
>         nMultiple = VBFunction( nLength & " * "  & nWidth)        (
> nAdd=15 )

>     End if

> Thanks, Russell



Sat, 26 Jun 2004 11:47:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Looking for an VB Eval Function

2. Eval function within VBSCRIPT for ASP on II@ 4

3. execute a variable as a function/sub procedure (like eval function in java(script))

4. Eval function in VB .Net and C#

5. Eval Function in VB.NET

6. EVAL function in VB.NET - where is it?

7. Does VB.NET has Eval Function?

8. Eval Function in VB.NET

9. eval function? how to call dynamic function name

10. Wish List Vote: Eval Function for VB

11. Is there an Eval function in VB?

12. Problem with VB for Access 97 using Eval function

 

 
Powered by phpBB® Forum Software