Eval Function in VB.NET 
Author Message
 Eval Function in VB.NET

Hi, All,
Is there something similar to the Eval function in VBScript such as
        set rs = eval("obj." & strMethodName)
in vb.net?

My code gets an xml attribute collection and assign the values to a list of properties that have the same names as the attribute names. It would be nice if we can do something like

        Dim iCounter as Integer = 0
        For iCounter < oNode.Attributes.count
            eval("ci." & oNode.Attributes(iCounter).name) = oNode.Attributes(iCounter).Value
            iCounter = iCounter+1
        Loop

Is it possible? Any suggestions?

Thanks!

Helen

Helen (Xiangqing) Sun, Ph.D.
Sr. Web Application Developer
Phone: 419-215-8458
www.xsun.net



Sat, 16 Oct 2004 22:27:17 GMT  
 Eval Function in VB.NET
the only eval function is in JScript, so you will need to work out how to
knock together a dll containing a method to wrap the jscript eval and call
that from your code.

--
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>
----------------------------------------------


Hi, All,
Is there something similar to the Eval function in vbScript such as
        set rs = eval("obj." & strMethodName)
in vb.net?

My code gets an xml attribute collection and assign the values to a list of
properties that have the same names as the attribute names. It would be nice
if we can do something like

        Dim iCounter as Integer = 0
        For iCounter < oNode.Attributes.count
            eval("ci." & oNode.Attributes(iCounter).name) =
oNode.Attributes(iCounter).Value
            iCounter = iCounter+1
        Loop

Is it possible? Any suggestions?

Thanks!

Helen

Helen (Xiangqing) Sun, Ph.D.
Sr. Web Application Developer
Phone: 419-215-8458
www.xsun.net



Sun, 17 Oct 2004 04:56:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Eval function in VB .Net and C#

2. Eval Function in VB.NET

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

4. Does VB.NET has Eval Function?

5. Eval() in VB.NET ??

6. JScript.Eval in VB.NET

7. Eval / Execute in vb.NET

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

9. eval function? how to call dynamic function name

10. Looking for a VB function like Eval() in ASP or Interpret in REXX

11. Wish List Vote: Eval Function for VB

12. Is there an Eval function in VB?

 

 
Powered by phpBB® Forum Software