Re: else on for
- Posted by David Cuny <dcuny at LANSET.COM> Aug 08, 2003
- 431 views
Karl Bochert wrote: > I very much like [else], but shouldn't the sense be reversed? > > for i = 1 to length( s ) > if s[i] = 999 then > break > end if > else > printf( "999 WAS found!!" ) > end for I see what you mean, but no. At least, not the way Python implements it, which is where I stole it from. Think of it this way: knowing the value was found it the easy part. That it wasn't found is more problematic. -- David Cuny