Is there an Eval function in VB? 
Author Message
 Is there an Eval function in VB?

There is an "Eval" function in the Visual Basic which is embedded in MS
Access, but this function doesn't exist in pure Microsoft Visual Basic. It's
a very useful function, that can take any input and evaluate it. For
example, in
result=Eval(3+2)
result has the value 5, but Eval can also evaluate other FUNCTIONS!

result=Eval("finddate()")
result has the value returned by finddate()

Does anyone know a function in pure VB that can do that?

(I can't use
result=finddate()
because "finddate()" is a string found through a query in a field of a table
(this field keeps names of functions)

Any ideas are welcome...

Thanks,
Elina



Tue, 27 Aug 2002 03:00:00 GMT  
 Is there an Eval function in VB?
Elina,
VB has a CallByName method that may suite your needs. You might want to
check the doc's to see if there are any restrictions for the types of
methods you can call with this.

Oscar Bowyer

Quote:

>There is an "Eval" function in the Visual Basic which is embedded in MS
>Access, but this function doesn't exist in pure Microsoft Visual Basic.
It's
>a very useful function, that can take any input and evaluate it. For
>example, in
>result=Eval(3+2)
>result has the value 5, but Eval can also evaluate other FUNCTIONS!

>result=Eval("finddate()")
>result has the value returned by finddate()

>Does anyone know a function in pure VB that can do that?

>(I can't use
>result=finddate()
>because "finddate()" is a string found through a query in a field of a
table
>(this field keeps names of functions)

>Any ideas are welcome...

>Thanks,
>Elina



Wed, 28 Aug 2002 03:00:00 GMT  
 Is there an Eval function in VB?
Oscar,
It was close to what I needed, but not perfect... I'll try to avoid this
function and change my code...
thanks a lot anyway :)
Elina


Quote:
> Elina,
> VB has a CallByName method that may suite your needs. You might want to
> check the doc's to see if there are any restrictions for the types of
> methods you can call with this.

> Oscar Bowyer



Wed, 28 Aug 2002 03:00:00 GMT  
 Is there an Eval function in VB?
Try adding the VBScript control to your program. You can execute a single
statement or a complex script program. It's not installed with VB6, but
hidden in one of the tools or unsupported directories on the installation
CDs.

          ..........Wayne

Check www.JustPC.com for my books on VB, SQL and other topics.


Quote:
> There is an "Eval" function in the Visual Basic which is embedded in MS
> Access, but this function doesn't exist in pure Microsoft Visual Basic.
It's
> a very useful function, that can take any input and evaluate it. For
> example, in
> result=Eval(3+2)
> result has the value 5, but Eval can also evaluate other FUNCTIONS!

> result=Eval("finddate()")
> result has the value returned by finddate()

> Does anyone know a function in pure VB that can do that?

> (I can't use
> result=finddate()
> because "finddate()" is a string found through a query in a field of a
table
> (this field keeps names of functions)

> Any ideas are welcome...

> Thanks,
> Elina



Wed, 28 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

2. Eval function in VB .Net and C#

3. Eval Function in VB.NET

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

5. Does VB.NET has Eval Function?

6. Eval Function in VB.NET

7. eval function? how to call dynamic function name

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

9. Wish List Vote: Eval Function for VB

10. Problem with VB for Access 97 using Eval function

11. Eval function in VBA, but not VB?

12. eval() function in VB?

 

 
Powered by phpBB® Forum Software