[comp.sys.mac] LSC: booleans != TRUE ?? -- missed point.

sdy@ssc-vax.UUCP (Sea Lance) (02/23/88)

From the responses I think I was slightly misunderstood (I never was real good
at explaining things). -- I realize that in C you should use if(RealFont())...
and not if(RealFont()==TRUE)... as mentioned by many helpful folks.

Only I had tried this earlier and it didn't seem to work (-- a few fixes later
and it now does) so when I was looking at the function RealFont I noticed that
it was a PASCAL Toolbox call that returned a boolean -- Not willing to trust
that a PASCAL TRUE would be the same as in C I used the #define'd TRUE
that seems to exist in one of the LSC header files, assuming it (and FALSE)
had been set up just to accomodate the returned PASCAL boolean values -- only
this wasn't the case.

I guess I was really asking why TRUE wasn't matching what was being returned
from RealFont() -- Do the PASCAL boolean Toolbox functions really return other
values than the LSC header defined TRUE and FALSE??

steve.

-- 
Steven D. Yee                 >>> my employer does not share my opinions  <<<
uw-beaver!ssc-vax!sdy         >>> (that's because I'm always right! ;-)   <<<

(chant) We want more!  We want more!  We want more lines than four!!!!!!!

edmoy@violet.berkeley.edu (02/25/88)

In article <990@ssc-bee.ssc-vax.UUCP> sdy@ssc-vax.UUCP (Sea Lance) writes:
>I guess I was really asking why TRUE wasn't matching what was being returned
>from RealFont() -- Do the PASCAL boolean Toolbox functions really return other
>values than the LSC header defined TRUE and FALSE??

As I recall, the answer is yes.  I remember having a similar problem when
I was using Megamax C compiler (don't worry, I'm converted to LSC, thank you).
Somewhere I read that in Pascal, a Boolean false was zero (no bits set) while
a Boolean true is -1 (all bits set).  The TRUE definition in the include
file is per C standard, but not Pascal standard.  So it is best to use

	if(RealFont()) ...

Edward Moy
Workstation Software Support Group
University of California
Berkeley, CA  94720

edmoy@violet.Berkeley.EDU
ucbvax!violet!edmoy