+Gemintronic Posted February 10, 2023 Share Posted February 10, 2023 Never questioned this, but, IF statements with more than 2 conditions have a hard time with boolean defs. So, this fails: if !dark && world_xy = rkey_xy && !owned_rkey then _COLUP1 = _rkey : gosub spr1_key bank6 But this works: if !roomflags{0} && world_xy = rkey_xy && !owned_rkey then _COLUP1 = _rkey : gosub spr1_key bank6 Is this the intended behavior? Quote Link to comment https://forums.atariage.com/topic/347790-if-statements-with-more-than-2-ands-lose-some-boolean-defs/ Share on other sites More sharing options...
+Random Terrain Posted February 10, 2023 Share Posted February 10, 2023 The bB page says this: The NOT operator can only be used with statements that do not include a comparison token (<, >, =) Are you sure the second one is working? Or is that another thing that changed over time and no one told us? 1 Quote Link to comment https://forums.atariage.com/topic/347790-if-statements-with-more-than-2-ands-lose-some-boolean-defs/#findComment-5206573 Share on other sites More sharing options...
+Gemintronic Posted February 10, 2023 Author Share Posted February 10, 2023 24 minutes ago, Random Terrain said: The bB page says this: The NOT operator can only be used with statements that do not include a comparison token (<, >, =) Are you sure the second one is working? Or is that another thing that changed over time and no one told us? Thank you! But, yeah. I just triple checked the 3 conditions and their combinations: dark (true/false) rkey_xy (current value/any other coordinate) owned_rkey (true/false) I guess I got used to going back to the non defined version of a boolean value when debugging. Didn't read well enough to understand it shouldn't work at all. 1 Quote Link to comment https://forums.atariage.com/topic/347790-if-statements-with-more-than-2-ands-lose-some-boolean-defs/#findComment-5206586 Share on other sites More sharing options...
+Random Terrain Posted February 10, 2023 Share Posted February 10, 2023 While working on a bB program, I look at the AND/OR/NOT chart 50 billion times a day since I can't remember any of it: https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#and_or_not_chart 1 Quote Link to comment https://forums.atariage.com/topic/347790-if-statements-with-more-than-2-ands-lose-some-boolean-defs/#findComment-5206600 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.