Execute/ Eval 
Author Message
 Execute/ Eval

Hi,

Is there a similar fucntion that works like Execute in VBScript or Eval in
JScript?

Charles



Mon, 22 Jul 2002 03:00:00 GMT  
 Execute/ Eval

Quote:
>Is there a similar fucntion that works like Execute in VBScript or Eval in JScript?

Charles,

No. But you can add a reference to MS Scripting runtime, and use the
VBScript Eval method from VB.

Mattias

__________________________________________________

     VB+ http://hem.spray.se/mattias.sjogren/
 Please send questions/replies to the newsgroups



Mon, 22 Jul 2002 03:00:00 GMT  
 Execute/ Eval
True...

You can also use any of the following techniques to get a similar effect:

    - CallByName (VB6 only)
    - Function pointers
    - Interfaces (w/ the right setup)

Also note that VBA (not VB) includes the Eval function without needing the
Windows Scripting host.

It is also fairly easy to write an expression evaluator for arithmetic /
other simple functional expressions.  I have also seen this kind of code for
free.  Let me know if I can be of any further assistance

Chase Saunders
Burgess Inc.

Quote:

>>Is there a similar fucntion that works like Execute in VBScript or Eval in
JScript?

>Charles,

>No. But you can add a reference to MS Scripting runtime, and use the
>VBScript Eval method from VB.

>Mattias

>__________________________________________________

>     VB+ http://hem.spray.se/mattias.sjogren/
> Please send questions/replies to the newsgroups



Mon, 22 Jul 2002 03:00:00 GMT  
 Execute/ Eval
Can you show me how can it be done? I try to add reference to MS Scripting
runtime (scrrun.dll) but there isnt any method for me to run script.

Many thanks,
Charles


Quote:
> >Is there a similar fucntion that works like Execute in VBScript or Eval
in JScript?

> Charles,

> No. But you can add a reference to MS Scripting runtime, and use the
> VBScript Eval method from VB.

> Mattias

> __________________________________________________

>      VB+ http://hem.spray.se/mattias.sjogren/
>  Please send questions/replies to the newsgroups



Tue, 23 Jul 2002 03:00:00 GMT  
 Execute/ Eval
Hi,

Suppose I have a new Function code that I wish to implement into my module.
However at the point of developing the application, it was not ready. How
can I now run the new code with rebuilding the VB applicaton.

Charles


Quote:
> True...

> You can also use any of the following techniques to get a similar effect:

>     - CallByName (VB6 only)
>     - Function pointers
>     - Interfaces (w/ the right setup)

> Also note that VBA (not VB) includes the Eval function without needing the
> Windows Scripting host.

> It is also fairly easy to write an expression evaluator for arithmetic /
> other simple functional expressions.  I have also seen this kind of code
for
> free.  Let me know if I can be of any further assistance

> Chase Saunders
> Burgess Inc.




- Show quoted text -

Quote:
> >>Is there a similar fucntion that works like Execute in VBScript or Eval
in
> JScript?

> >Charles,

> >No. But you can add a reference to MS Scripting runtime, and use the
> >VBScript Eval method from VB.

> >Mattias

> >__________________________________________________

> >     VB+ http://hem.spray.se/mattias.sjogren/
> > Please send questions/replies to the newsgroups



Tue, 23 Jul 2002 03:00:00 GMT  
 Execute/ Eval
You want the Script Control, msscript.ocx. Be aware the documentation is
pretty poor.

Sax Basic (http://www.saxsoft.com) is a much more complete scripting
environment like VBA -- probably more than what you need but others
following this thread might be interested.


Quote:
> Can you show me how can it be done? I try to add reference to MS Scripting
> runtime (scrrun.dll) but there isnt any method for me to run script.

> Many thanks,
> Charles



> > >Is there a similar fucntion that works like Execute in VBScript or Eval
> in JScript?

> > Charles,

> > No. But you can add a reference to MS Scripting runtime, and use the
> > VBScript Eval method from VB.

> > Mattias

> > __________________________________________________

> >      VB+ http://hem.spray.se/mattias.sjogren/
> >  Please send questions/replies to the newsgroups



Tue, 23 Jul 2002 03:00:00 GMT  
 Execute/ Eval

Quote:
>Can you show me how can it be done? I try to add reference to MS Scripting
>runtime (scrrun.dll) but there isnt any method for me to run script.

Charles,

Oops. Like RJolt said, it should be the Script control, not the
Scripting runtime. Sorry for the confusion.

Mattias

__________________________________________________

     VB+ http://hem.spray.se/mattias.sjogren/
 Please send questions/replies to the newsgroups



Tue, 23 Jul 2002 03:00:00 GMT  
 Execute/ Eval
That's a piece of cake... you won't need you use any of the advanced
techniques discussed above; a simple dynamic link library (DLL) will
suffice, especially if you know the function parameters and return type in
advance.  Just make an ActiveX dll with a Public class, containing the
public function... it doesn't have to do anything, just make the call to it
in your main app, as if it were written and working.  Later you can
recompile the DLL with new code, without having to recompile your EXE.

Chase



Tue, 23 Jul 2002 03:00:00 GMT  
 Execute/ Eval


Quote:
> True...

> You can also use any of the following techniques to get a similar effect:

>     - CallByName (VB6 only)
>     - Function pointers
>     - Interfaces (w/ the right setup)

There's one big problem with CallByName - it trashes the Error information.
I was trying to implement a Properties() method for my classes without
resorting to a large Select Case statement, and CallByName seemed like a
perfect solution until I found out that any errors occuring would not
provide normal error information, but only one of the generic
'Application-defined' or 'Automation' errors (I can't remember which). MS
has a KB article about this saying it is 'By Design' which means they're
either too lazy or too incompetent to fix it. The more I use VB, the more I
realize that the developers at MS who write it don't actually use it, or
else they'd fix a lot more of these annoying little problems.

Jeff

Quote:
> Also note that VBA (not VB) includes the Eval function without needing the
> Windows Scripting host.

> It is also fairly easy to write an expression evaluator for arithmetic /
> other simple functional expressions.  I have also seen this kind of code
for
> free.  Let me know if I can be of any further assistance

> Chase Saunders
> Burgess Inc.




Quote:
> >>Is there a similar fucntion that works like Execute in VBScript or Eval
in
> JScript?

> >Charles,

> >No. But you can add a reference to MS Scripting runtime, and use the
> >VBScript Eval method from VB.

> >Mattias

> >__________________________________________________

> >     VB+ http://hem.spray.se/mattias.sjogren/
> > Please send questions/replies to the newsgroups



Tue, 23 Jul 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Executing code that is stored in a table, Eval() function

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

3. Eval / Execute in vb.NET

4. execute and eval

5. execute() and eval()

6. Eval & Execute functions

7. Simulate VBScripts Execute and Eval in VB?

8. eval to execute - sub - Please Help.

9. Faking functionality to VBScript Execute and JavaScript eval......

10. qdf.Execute vs. db.Execute

11. ADO: cmd.Execute vs cn.Execute

12. _ conn.execute or cmd.execute?

 

 
Powered by phpBB® Forum Software