arekowczarek Posted November 17, 2010 Report Share Posted November 17, 2010 Few month ago I accidently used this IF command in a macro: If variable %T% is greater than %T% do something End if I couldn't figure out what was happening with the macro untill I saw the typo (originally I was supposed to compare %N% and %N%). I didn't know I could compare text strings that way. I figured, macro was checking which variable was longer. I tried it with few random words and my theory proved right. I was like 'Cool, now I will be able to skip "variable set integer to the length of text variable" by simply using the string itself to compare. Today I tried this "trick" and it wouldn't work. Macro claimed that %T%="john" is greater than "%T%="africa". That left me stunned for 7 minutes. Then I realized macro wasn't comparing the variables' length at all. It was checking which of the two variables comes first in the alphabetical order. Which by the way is very handy. I wish there were some info in ME Help file about this particular use of IF commands. Cause that's where I turn first if I want to see possible uses of a command. It just sounds so odd, that "b" is greater than "a", and "a" is less than "b" (apart from ie.: if "africa" contains "a" or if "africa" equals "africa".) To me at least. That's it. No problem to solve, just felt like sharing Maybe somebody finds this useful. I searched the forum for posts concerning the topic and didn't found any info on this usage of IF command. I hope it's not because it's such common knowledge that is not worth mentioning, and I was the only one who didn't know about it Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.