Force Var assignement

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Force Var assignement

Post by drunkenmonkey » Wed Apr 14, 2021 11:41 am

Hi support!
Need to know why my var Taux does not assign value N. It assigned value 2 instead.
I'm sure it's a simple explanation.

https://u.pcloud.link/publink/show?code ... ibJy0xEbH7

Thank you again for your help! :D

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Force Var assignement

Post by drunkenmonkey » Wed Apr 14, 2021 3:18 pm

Found my answer.
The var N is always seen as a boolean I guess that is why MS will set the value as 2.
I changed the value for T and the var result was T.
That is my finding. :D :D :D

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Force Var assignement

Post by JRL » Wed Apr 14, 2021 8:09 pm

The letter "N" is always seen as the letter "N" unless your code sets it to some other value. It is not a boolean value. Apparently, somewhere in your code you have set "N" equal to 2 so when you set "Taux" to "N", the value of "Taux" becomes 2. There is no other explanation.

I never use single characters as variables. Too much confusion ensues when I do.

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Force Var assignement

Post by drunkenmonkey » Fri Apr 16, 2021 3:00 am

Thank you for your reply. I understand the assignation of a var. I review the code and coul'nt find an assignation to 2. What I did is change the var name and value in all the code and it work as it suppose.
Again thank you for your comment, it is appreciated. :D

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