How many OR's can I use?
cubegleamer
Junior Member
Can I do
this || this || this ?
I have a block of code that is working except that it seems to be ignoring that third conditional.
Disregard syntax, I think you get what Im saying
this || this || this ?
I have a block of code that is working except that it seems to be ignoring that third conditional.
Disregard syntax, I think you get what Im saying
Comments
-
I don't think this is allowed in NetLinx. Use parentheses, e.g. this || (that || the_other)
You could also add them in most cases but it's obviously less efficient. -
Thank you Thank you Thank you
(There forum gave me an error that one "Thank you" was not sufficient. (Minimum of 10 characters). -
Well, it does work how I originally had it. But only AFTER I tried it how you suggested.
So, to be clear, didnt work how I originally had it, tried it your way and it worked, changed it back how I originally had it and it worked.
Ugghhh...Im experiencing the weirdest things with Netlinx. Its like it needs to be kicked one time in the right place and then it will work forever after. Weird. The other instance of this weirdness I had was using a constant in a function (function resides in an Include) that I called from a module. The constant was defined in the Include. Well it wouldnt work until I used the actual value instead of my constant. Then I could go back and use the constant and it would work every time. I had to do this in every instance where I called that function. What a pain... -
cubegleamer wrote: »Well, it does work how I originally had it. But only AFTER I tried it how you suggested.
So, to be clear, didnt work how I originally had it, tried it your way and it worked, changed it back how I originally had it and it worked.
Ugghhh...Im experiencing the weirdest things with Netlinx. Its like it needs to be kicked one time in the right place and then it will work forever after. Weird. The other instance of this weirdness I had was using a constant in a function (function resides in an Include) that I called from a module. The constant was defined in the Include. Well it wouldnt work until I used the actual value instead of my constant. Then I could go back and use the constant and it would work every time. I had to do this in every instance where I called that function. What a pain...
Modules are in a closed sandbox, so the include constants were outside of the module's scope. -
cubegleamer wrote: »Can I do
this || this || this ?
I have a block of code that is working except that it seems to be ignoring that third conditional.
Disregard syntax, I think you get what Im saying
Yes I do this all the time without issue. You do have to be careful about combining operators but in Netlinx || is already the lowest precedence I believe.
Paul -
I never did bother to memorize all the NetLinx precedence rules, because I've found that forcing it via parentheses makes it both unnecessarily to rely on precedence and easier to read later on. So I wind up using parentheses a lot more than is absolutely necessary.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums