Oh, yeah, if he wants to return the flag, he should change it to an int, I totally agree. (which the name of the funtion implies he wants to do!)
But, this could be useful just to see if any flag is set at all. :) (again, i don't think that's what this guy wants to do) -----Original Message----- From: Tom Whiting [mailto:[EMAIL PROTECTED] Sent: Saturday, July 13, 2002 9:04 AM To: [email protected] Subject: RE: Help with a strange problem please hmmmm, well, I see your point there honestly, BUT, if you want it to return something ele (ie: what the flag actually is), then yo're pretty much going to have to rewrite it. As I don't see but maybe 5 lines of code, I must borrow Edwin's crystal ball sometimes, and lately that's been lettin me down.. :P As I said though, the line you're choking on is PROBABLY because acct_flags isn't initialized (unless that's done globally). You can't just throw arguments into a statement like this. Where are acct_flags coming from? They're used 2x, one looks like it's a field, one a structure, so that could be a problem too. Start, with trying to clean up the way acct_flags are handled in this bit of code.. Sorry I can't be much more help On Sat, 2002-07-13 at 07:54, Jason Gauthier wrote: > Actually, a bool is TRUE if the comparison in question does not evaluate to > 0. > > So, what you state is correct, it's for TRUE or FALSE. > What he is using it for here, is legitimate. > > > Can anyone help me with a very strange problem I am having? Basically, my > > code looks like: > > > > bool get_flag( int index ) > > { > > bool ret_val = FALSE; > > if( acct_flags ) *** > > ret_val = acct_flags->bit[ index ]; > > > > return ret_val; > > } > First off, bool is for boolean functions, and SHOULD only return TRUE or > FALSE, nothing else. > so, that said, you might consider redoing somthing like int get_flag(int > index), instead.. That seems to be more appropriate. > -- TJW :Head tech, designer, bum:P Mud :http://dreamless.wolfstream.net telnet :telnet://dreamless.wolfstream.net 9275 OLC Pages:http://olc.wolfstream.net -- ROM mailing list [email protected] http://www.rom.org/cgi-bin/mailman/listinfo/rom

