I have a string that like this.
Dim switchClause As String
switchClause = "1 = 0"
I want to then use the switchClause in an If statement like this.
If switchClause Then
' Do something cause it was true.
Else
' Do something else cause it was false.
End If
The above doesn't work so I found the Parse() method of the Boolean object. Unfortunately for me it only will accept the following four strings:
"0", "1", "False", "True"
All of which are useless to what I'm doing. I tried wrapping an additional set of " inside the string but this failed as well when used directly with the If statement. Is there any way at all to parse this string into a boolean as if it was actually in the code? Any help will be a life saver thanks!!!
Dim switchClause As String
switchClause = "1 = 0"
I want to then use the switchClause in an If statement like this.
If switchClause Then
' Do something cause it was true.
Else
' Do something else cause it was false.
End If
The above doesn't work so I found the Parse() method of the Boolean object. Unfortunately for me it only will accept the following four strings:
"0", "1", "False", "True"
All of which are useless to what I'm doing. I tried wrapping an additional set of " inside the string but this failed as well when used directly with the If statement. Is there any way at all to parse this string into a boolean as if it was actually in the code? Any help will be a life saver thanks!!!