Eval function using a custom typed variable 
Author Message
 Eval function using a custom typed variable

Situation:
I am storing an expression to be evaluated in a table:

gFile.State = "CA"

gFile being a custom typed global structure

I store this expression in a table to be evaluated to determine if a
specific form should print (many forms are being considered for
printing)

Problem:
I am trying to use the Eval function to determine if the global
variable  gFile.State is equal to the string "CA". If I type
Eval(gFile.State = "CA") in the debug wimdow the code is evaluated
properly. When I loan the string "gFile.State = 'CA'" into a local
module variable (tVar) and then Eval(tVar) I get an error on gFile due
to the "." period in the expression for the type variable. The tVar
indeed holds "gFile.State = 'CA'"

Is there a problem using Eval with global variable or typed variables?
Has anyone tried this and have a workaround?

I have a workable solution but it is code intensive, any help will be
appreciated.

Thanks in advance

Frank Tuttle



Sun, 28 Nov 1999 03:00:00 GMT  
 Eval function using a custom typed variable

Frank

Try using the following format to store in table for setting tVar prior to
using Eval function:

tVar = cstr(chr(39) & gFile.state & chr(39) & " = 'CA'")

Hope this helps

Joyce
------------------------



Quote:
> Eval(gFile.State = "CA") in the debug wimdow the code is evaluated
> properly. When I loan the string "gFile.State = 'CA'" into a local
> module variable (tVar) and then Eval(tVar) I get an error on gFile due
> to the "." period in the expression for the type variable. The tVar
> indeed holds "gFile.State = 'CA'"

> Is there a problem using Eval with global variable or typed variables?
> Has anyone tried this and have a workaround?



Mon, 29 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. is there an eval type function?

3. Eval() type of function?

4. Using the EVAL() function

5. Help Using Eval Function

6. Problem with VB for Access 97 using Eval function

7. Saving custom user type variables

8. Calling a sub or function using a variable through another sub or function

9. eval function? how to call dynamic function name

10. declaring a function that returns a custom type

11. Does VBScript has a function similar to JScript function eval

12. Using types in a different assembly given that the type may be used or not used

 

 
Powered by phpBB® Forum Software