Is there a function in VB that will evaluate an expression and return a result?
Example (1=1) = True
Printable View
Is there a function in VB that will evaluate an expression and return a result?
Example (1=1) = True
Try using Eval, which is in the Scripting Host (look under Project->References).
with VB7.0 will come
C/C++ Style Boolean Short-circuiting on “if then” statements
If Not (x Is Nothing) And (x.Prop = 5) Then
The above will now work. In VB6 you had to write :
If Not (x Is Nothing) Then
If (x.Prop = 5) Then
soon
Hang in there, Angela!
Parksie,
Trying to use Eval function. I can't find the Scripting Host under Project References. Is that the exact name of the reference? If so, I haven't got it - any tips on how I can get it?
Cheers
Nick
Under components: Microsoft Script Control
I think this gets installed with a certain version of interner explorer.
I don't see the problem?
Code:Private Sub Command1_Click()
Dim b As Boolean
b = (1 = 1)
MsgBox b
End Sub
I don't seem to have the Microsoft Script Control installed, but I have installed IE3, 4 and 5!
Do you have the filename for the DLL? maybe it's buried somewhere on my system.
Thanks
Nick