Article ID 1631
Article Title INFO: The history of True and False according to DataFlex
Article URL http://www.dataaccess.com/KBasePublic/KBPrint.asp?ArticleID=1631
KBase Category Visual DataFlex
Date Created 07/12/2002
Last Edit Date 02/27/2009


Article Text
The following are excerpts from the Visual DataFlex Forum,
the thread is titled "Regarding Move & Set" and was started on 07/09/2002.

QUESTION:
How do I use Boolean properties?

bWait is a variable declared inside a Procedure

Move FALSE to bWait
The compiler gave errors.

Set bWait to FALSE
Compiled OK and when I ran the program, the moment execution reached this
statement the entire program shutdown. No errors nothing. Took me a while to
figure out where the problem was.

Move (FALSE) to bWait.
Everything works OK.


Later in the thread, someone asked whether True and False are functions, based on this:

From the VDF7 FMAC:

  #REPLACE TRUE $1
  #REPLACE FALSE $0

  #REPLACE DFFALSE       |CI0
  #REPLACE DFTRUE        |CI1


ANSWER:
You'll be sorry you asked about this one.

Historically, this was a very strange duck that goes way back. The
definition of TRUE and FALSE as $1 and $0 is needed to make the indicate
command work. Even though we no longer advise developers to use this command
it is still supported.  The indicate command use $1 and $0 in a very strange
way. basically it used these symbols to execute another fmac command by
appending the passed TRUE or FALSE value to a command name INDCT$. This
resulted in the calling of two commands, either INDCT$$1 or INDCT$$0.

This is why TRUE and FALSE has always had this weird definition of $1 and
$0. This is also why TRUE and FALSE could not be used everywhere. They could
be used in some commands (set/get explicitly looked for $1 and $0 while move
did not) and they could be used inside of parenthesis (because the
expression evaluator handled these symbols in a completely different way).
At some point we created the symbols DFTRUE and DFFALSE. They were real
constants and could be used anywhere (except in Indicate commands). This was
always pretty silly. Somehow it implied that we had a different definition
for TRUE and FALSE than then rest of the world. In reality it was just an
extra symbol we created because TRUE and FALSE were limited.

In 8.2 we've cleaned this up by changing the Indicate command so it does not
do the INDCT$ + $1 trick anymore. TRUE and FALSE are now real constants
(boolean 1 and 0) and True/False can be used anywhere. dffalse and dftrue
are still supported but are obsolete as they can now always be replaced with
True and False.

- John Tuohy




Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2024 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.