Don't call an important func as part of an OR test

BlitzMax Forums/BlitzMax Programming/Don't call an important func as part of an OR test

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

if AnimFunction1 returns true, anim=1 and therefore the second line goes "OK anim=1 so I don't even need to look at the part after the OR" and so AnimFunction2 never gets called!

Yes. If I were writing a program like that, my instinct would be to:

Local Anim1 = AnimFunction1()
Local Anim2 = AnimFunction2()
If Anim1 Or Anim2 Then

But then I'm old-fashioned... My primate brain never tries for excessive cleverosity with my dull, excessively easy-to-understand code (hey, it learned programming in the early 80s and never much grew out of that). <g>