|
-
February 15th, 2000, 11:51 PM
#1
how to evaluate expressions
i got few expressions containing logical "And" ,"Or" .this expressions are in a text file in the following format.
result=((var1And var2)or(var3 And var4)) etc.The expression can be in any number of "and's & or's".
i want to use the VB6.0 logical operators to evaluate my expression.
How will these expression get copied or moved to vb code from the file?
or How will the operators work within a file?
-
February 16th, 2000, 02:26 AM
#2
Re: how to evaluate expressions
you can use the Microsoft Script Control in your VB program.
It has an Eval method that can evaluate any expression that is passed as a string.
-
February 17th, 2000, 03:36 AM
#3
Re: how to evaluate expressions
sir will u please tell in detail how will u do that.
also please take a note that the string of expressions is in *.txt format
-
February 17th, 2000, 04:01 AM
#4
Re: how to evaluate expressions
here is a sample
private Sub Command1_Click()
Dim hFile as Integer
hFile = FreeFile
Dim strLine as string
Open "c:\test.txt" for input as #hFile
Do While Not EOF(hFile)
Line input #hFile, strLine
s.ExecuteStatement strLine
Loop
Close (hFile)
End Sub
contents of test.txt
msgbox "hello.world"
msgbox "greetings from the script control"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|