a=b vs %a%=%b% vs {%a%=%b%}

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Fred
Newbie
Posts: 18
Joined: Sat Aug 05, 2017 4:44 pm

a=b vs %a%=%b% vs {%a%=%b%}

Post by Fred » Sun May 13, 2018 7:51 pm

What is the difference between these in logical operations? Which one should I use comparing the numbers or in calculations?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: a=b vs %a%=%b% vs {%a%=%b%}

Post by Marcus Tettmar » Mon May 14, 2018 1:52 pm

It kinda depends. One thing it depends on is whether you have VAREXPLICIT enabled. If it is enabled then the first one will look at literal values and will therefore be false. The second two are the same.

Step through this with the debugger to see what I mean:

Code: Select all

Let>a=apple
Let>b=apple

//this would be true
If>a=b
  //true
Endif


//this would be false
Let>VAREXPLICIT=1
If>a=b
  //true
Endif

//true
If>%a%=%b%
  //true
Endif

//true
If>{%a%=%b%}
  //true
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts