problem with boolean

Author: (uniface8)

Hi all, in U8.2 when i compare a boolean variable with 0 if that variable have no value, uniface returns FALSE; e.g:

entry my_proc
     boolean vb_aux

if (vb_aux=0)
     ;do one thing
     ;do another thing


In the same situation with uniface U9.4 the if clause returns TRUE:

I know that we have to give an initial value to all variables always, but its not my app, I´m doing the migration.
Someone knows a workaround? I mean, if I give an initial value to all variables works fine, but there´s a lots of frm,...

Regards, Rafa.



  1. Hi Rafa,

    instead of comparing against a value, just use the boolean variable itself:

    if (vb_aux)

    or using the negation with a "!" in front:

    if (!vb_aux)


    Or if you like you can compare against an expression:

    if (vb_aux = 1 = 2)

    Think once upon a time it was exüöained in the "handling data in proc" chapter of the Quick Reference Guide.

    Success, Uli


    Author: ulrich-merkel (
  2. Thank you Uli, you´re right (as usual), but it means that I have to change all components, I  was thinking in a parameter of asn file or similar.

    Any ideas?

    Regards, Rafa.

    Author: uniface8 (
  3. For this, you better ask someone paied by CPWR, not a little customer like me.

    They changed a lot in V9 causing terrible side effects for our code, as your example shows.

    With a lot of luck they may have a solution for you (and may be willing to tell you as well).


    P.S. we all know about these "undocumented" necessities which are unveiled rarely
    looks like "the lab" has some fun keeping existing functionality away from us, the paying customers

    Author: ulrich-merkel (
  4. Hello Rafa,

    The version 9.4 is correct. In the description of the Boolean data type it says (see "Uniface Library > Uniface Reference > Data Types > boolean"):

    "An empty value, and the values 0, F, f, N, and n are interpreted as FALSE."

    The bellow described Proc only worked in Uniface 8.2, because of the known problem #24949 ("V8 migration: inconsistency in boolean processing between versions 7 and 8") - for details see symptom 2:

    "2. When processing an uninitialized boolean field in proc code, the result received is inconsistent from previous UNIFACE versions and is not as documented. For example, a condition of (boolean='F') and (boolean="T') will both fail for an uninitialized boolean, while in previous UNIFACE version the condition of (boolean='F') would be satisfied. Simlarly, the condition of (boolean!='T') would be satisfied in previous UNIFACE versions for an uninitialized boolean, while in version 8 both (boolean!='T') and (boolean!='F') will succeed. As per documentation, an empty boolean field should be interpreted as 'False'."

    And the above mentioned problem has been solved in version 8.4 and in patches for version 8.2.02 and 8.3.01.

    So in order to resolve the "migration" problem (I'm afraid) you have to change the Proc of the app in one way or another.

    Hope this helps.

    Kind regards,

    *** Usual disclaimer ***

    Author: diseli (
  5. Thank you for your answer Daniel.
     I´m afraid that I have to change  a lot of components ^_^


    Author: uniface8 (