Hi all,
I want to use if statement and i am reading condition/expression from text file and storing in a string/object variable.
now i want use that string/object as my condition in if statement like below.
Dim sourceLogic as String ="reading from a text file"
if sourceLogic then
'do something
End If
can we use like above.
please help me.
Can we use string as expression in if statement in vb.net
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Manikavelu VelayuthamRank #413 · 6K reputationPosted Aug 24, 2010, 3:21 AM EDT
eg:
if true then.......
if (i<0) .....
if (!true)......
simply you cant use the string in the expression...either you should check for empty string or null value, it will work