Sign in to follow this  
Followers 0
nikosliapis

String to expression

5 posts in this topic

Hello everybody, i again need your help

i need a way to convert a string to an expression.

For example in the following script i used (without success) the "StringToBinary" command

$a=True
$b=True
$expr = "$a And $b"
MsgBox(0,"Correct", $a And $b)
MsgBox(0,"Wrong", StringToBinary($expr))

What i need is a way to "say" to autoit that the script $expr is not a script but an expression.

Any ideas?

Thanks in advance.


Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites



Try removing the quotes around your $expr statement, for starters:

$expr = $a And $b

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Jlogan

thank you for the replie but I'm afraid you didn't understand my question.

$expr must be a string at the begining and i need to "convert" it to an expression.

Remember that the posted code is only an example.


Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites

Thank you JohnOne that works pretty good.


Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0