Forum > Beginners
[SOLVED] Boolean condition
(1/1)
phylax:
Hi,
I have the following statements in my program:
--- Code: ---TemporaryBool:= (Variable1 <> Variable2);
...
if TemporaryBool then ProcessNotEqualCondition;
--- End code ---
Debug tells me that Variable1 and Variable2 have the same value (both are strings) yet TemporaryBool is True after the statement executes. What am I, a newbie, misunderstanding here?
Thanks in advance.
howardpc:
Does
--- Code: --- TemporaryBool:=not SameText(Variable1, Variable2);
--- End code ---
give an identical result?
phylax:
Sorry, my mistake - the variables weren't equal after all. One of them had a single trailing space (the Trim routine solved the problem).
Thanks, howardpc - that SameText routine was new to me and I'm grateful to you for making it known to me.
Navigation
[0] Message Index