On 7/23/07, James Paige <[EMAIL PROTECTED]> wrote: > This is just a reminder, since I have had to clean up a few of these > recently. The following code is bad: > > DIM array(n) > IF index >= 0 AND index <= n AND array(n) = somevalue THEN ... > > In a language that has short-circuit evaluation of AND operators, the > above code would be okay, but in freebasic it is not, because array(n) > will be read even if n is out of range.
I think that FB should implement VB's "AndAlso" and "OrElse" operators, which are short-circuiting logical operators. -- Mike Caron Tale of the Cave http://taleofthecave.com _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
