Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BOOL Datatype
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00357504
Message ID:
00359120
Vues:
11
>As I've said elsewhere in this thread this was a simply a curiousity to me. Personally, it doesn't make a bit of difference. Second, you know me well enough to know that whenever I make an API call that returns a BOOL, it's in the format of: llresult = (SomeBOOLAPICall() # 0).

I know. Not all explanations were meant for you. :)

>That aside, the curiousity was inspired because it (TRUE) seemingly isn't defined recursively (namely as in QB you'd do a CONST TRUE% = NOT FALSE). Whatever unary NOT returned became the value for TRUE. In this case, it happened to be the bitwise compliment.

Now, guess what: if TRUE were defined recursively, than TRUE would be !FALSE, which is 1. "!" is logical NOT, not
bitwise NOT, which is something different in C++.

Since TRUE is defined by a macro (#define) in C++, its definition as 1
(its actual definition is #define TRUE 1) is better. Macros are a big PITA in C++ and it's better to keep them
as simple as possible.

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform