var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Convert string to condition
I have the following code that doesnt work...
The error I get is
Public Sub temp()
Dim strwhere, signs As String
Dim num1, num2 As Single
num1 = 1
signs = ">"
num2 = 2
strwhere = num1 & signs & num2
If strwhere Then
MsgBox ("num1 is > num2")
MsgBox ("num2 is > num1")
Type Mismatch in strwhere. I need the code to work this way 'cos num1, signs and num2 are stored as records in a condition table.
Any help is appreciated!!!
Try the following:
If signs = ">" Then
MsgBox ("num1 is > num2")ElseIf signs = "<"
MsgBox ("num2 is > num1")Else
MsgBox ("num2 is = num1")End If
How to convert a string (say '>') to an operator (>)
Thanks for the reply, Hambakka....
Just wondering... is there no function to convert string to an operator?
It would make my life simple, if there is one...
Sorry, there is no function to do that, but you can write it yourself.
Can u help me with the code?
Function String2Sign ( thisString )
Select Case UCase ( thisString )
String2Sign = "<"
Case "LE" ' Less than or equal
String2Sign = "<="
String2Sign = ">"
Case "GE" ' Greater than or equal
String2Sign = ">="
Case "EQ" ' Equal
String2Sign = "="
Case "NE" ' NOT Equal
String2Sign = "<>"
String2Sign = ""
[/ QUOTE ]
Calling [ COLOR = DarkOrchid ] String2Sign ( "LT" )[/ COLOR ]
will result in '<'