True/False

D

David

Learning Access and would like to know if there is any
advantage/disadvantage of using -1 or 0 instead of True
or False

Thanks in advance
 
D

Douglas J. Steele

Not as far as I'm concerned. You may see people who do things like sum the
value of a boolean field and reverse the sign to determine how many trues
have been selected, but I think it's a mistake to base things on the current
implementation of a value. After all, in VB.Net, True is now 1, not -1.
 
V

Van T. Dinh

In my opinion, True and False are just symbolic constants for -1 and 0,
anyway.

I prefer to use True & False in code since they look more logical than -1
and zero.

In pure JET SQL, I also use True and False. If I use another SQL, e.g. SQL
Server, then I use <> 0 for True and = 0 for False since universally (I
think) 0 is logical False and logical True is represented differently in
different SQL (but True is <> 0 since 0 = False).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top