• QJo (unregistered)

    Aristotle would have shat.

  • RandomGuy (unregistered)

    IS_FRIST_YN = UNKN

  • Mike5 (unregistered)

    My eyes! The goggles do nothing!

  • jaggerbush (unregistered)

    I'd love to see the truth table generated from that.

  • (cs)

    I'm sorry, but if a truth-table does not contain FILE_NOT_FOUND or its equivalent, then it cannot pass as a truth table.

  • QJo (unregistered)

    "No" is indeed serviced. It's UNKN, which stands for "U nasty kids! No!"

  • faoileag (unregistered) in reply to Alargule
    Alargule:
    I'm sorry, but if a truth-table does not contain FILE_NOT_FOUND or its equivalent, then it cannot pass as a truth table.
    So you are saying that a truth table column in a database must always be at least char(14)?
  • (cs)

    If they used Oracle, they wouldn't need two values for null and empty string.

  • (cs)

    I found this in a program I inherited:

    #ifndef _ZOMBOOLEAN_H_
    #define _ZOMBOOLEAN_H_
    
    enum ZomBoolean
    {
     False=  0,
     True=   1,
     Zombie=-1,
     FileNotFound=53
    };
    
    #endif

    I assume (hope) it's a joke.

  • Warren (unregistered)

    Of course, you could optimise that to a bit-field, which would also helpfully support multiple values in one.

  • (cs) in reply to faoileag
    faoileag:
    Alargule:
    I'm sorry, but if a truth-table does not contain FILE_NOT_FOUND or its equivalent, then it cannot pass as a truth table.
    So you are saying that a truth table column in a database must always be at least char(14)?
    No, 3 chars will do just fine:

    YES NO 404

  • ANON (unregistered)

    "NULL - the string" sounds like Comic hero.

  • faoileag (unregistered) in reply to Warren
    Warren:
    Of course, you could optimise that to a bit-field, which would also helpfully support multiple values in one.
    You mean, like YES | FALSE? Yes, I can see where this would be helpful! May I propose "MAYBE" for the eight value?
  • Tim (unregistered)

    here's my favourite - described as a "tri-state Boolean" - but with 5 possible values!

    http://msdn.microsoft.com/en-us/library/office/aa432714(v=office.12).aspx

  • Sizik (unregistered) in reply to Tim
    Tim:
    here's my favourite - described as a "tri-state Boolean" - but with 5 possible values!

    http://msdn.microsoft.com/en-us/library/office/aa432714(v=office.12).aspx

    It was designed for use within the New York metropolitan area.

  • An innocent abroad (unregistered) in reply to faoileag
    faoileag:
    Warren:
    Of course, you could optimise that to a bit-field, which would also helpfully support multiple values in one.
    You mean, like YES | FALSE? Yes, I can see where this would be helpful! May I propose "MAYBE" for the eight value?
    That's too imprecise. There's USUALLY | REGULARILY | OCCASIONALY | RARELY to cover, plus the spelling-corrected versions of them.

    I hear it's called fuzzy logic.

  • faoileag (unregistered) in reply to Tim
    Tim:
    here's my favourite - described as a "tri-state Boolean" - but with 5 possible values! http://msdn.microsoft.com/en-us/library/office/aa432714(v=office.12).aspx
    I love it! Especially the fact that your link states that msoTriStateMixed is "Not supported" whereas http://msdn.microsoft.com/en-us/library/office/ff746389.aspx notes that the parameter EmbedFonts of the Presentation.SaveAs() method is of type MsoTriState and that msoTriStateMixed is the default value.
  • Mr Zombo (unregistered) in reply to joelkatz
    joelkatz:
    I found this in a program I inherited:
    #ifndef _ZOMBOOLEAN_H_
    #define _ZOMBOOLEAN_H_
    
    ... I assume (hope) it's a joke.

    Not a joke. That is the variable type which powers zombo.com - you can do anything with ZomBoolean in your programs!

  • faoileag (unregistered) in reply to An innocent abroad
    An innocent abroad:
    faoileag:
    Warren:
    Of course, you could optimise that to a bit-field, which would also helpfully support multiple values in one.
    You mean, like YES | FALSE? Yes, I can see where this would be helpful! May I propose "MAYBE" for the eight value?
    That's too imprecise. There's USUALLY | REGULARILY | OCCASIONALY | RARELY to cover, plus the spelling-corrected versions of them.
    Hmmm, that leaves another 16 values to be filled on a 32-bit system... what about "TRUEINCOURT", "TRUEINART" and "DOMESTICTRUE" to differentiate between different truth values?
  • vt_mruhlin (unregistered)
    Wayne supports an application that uses its own custom macro-language to define how to generate Word documents. It’s database driven

    Really could have just ended the WTF there.

  • QJo (unregistered) in reply to faoileag
    faoileag:
    An innocent abroad:
    faoileag:
    Warren:
    Of course, you could optimise that to a bit-field, which would also helpfully support multiple values in one.
    You mean, like YES | FALSE? Yes, I can see where this would be helpful! May I propose "MAYBE" for the eight value?
    That's too imprecise. There's USUALLY | REGULARILY | OCCASIONALY | RARELY to cover, plus the spelling-corrected versions of them.
    Hmmm, that leaves another 16 values to be filled on a 32-bit system... what about "TRUEINCOURT", "TRUEINART" and "DOMESTICTRUE" to differentiate between different truth values?
    Don't forget A_THOUSAND_MILLION_PER_CENT (which logically equals FALSE) for Maury Povich truth.
  • EvilSnack (unregistered)

    Not to mention the fun of dealing with different methods of returning errors. Some functions return zero for no error and non-zero to name specific errors, whereas other functions return non-zero for no error and zero for an error, and then you call some system function to get the last error.

  • anonymous (unregistered)

    FILE_NOT_FOUND

    Mmm, bacon.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    If you bool it, they will come!

  • Krunt (unregistered) in reply to QJo
    QJo:
    "No" is indeed serviced. It's UNKN, which stands for "U nasty kids! No!"

    "NO" is implicitly defined in this instance; it would be overkill to define a constant for it.

  • Wayne (OP) (unregistered) in reply to vt_mruhlin
    vt_mruhlin:
    Wayne supports an application that uses its own custom macro-language to define how to generate Word documents. It’s database driven

    Really could have just ended the WTF there.

    Submitter here. Pretty much. It's meant to generate .doc files without requiring VBA for each document (we have over a thousand documents, not total I mean templates), so the app gets coded up with this weird VB-like syntax that an in-house application parses and replaces, for example it will parse the line:

    Customer Name: {FIELD CUST_NAME}

    with:

    Customer Name: Bob Jones

    when the document is parsed by the application. And it has loops and conditional statements too so I could do something like:

    {IF CUST_ORDERS > 20}Status: Preferred {ELSE} Status: Normal {END}

    where "CUST_ORDERS" is a field returned by the stored procedure associated with each document (each document has a query defined at the top that gets run and provides the resultset for that particular document, with parameters and the like passed in using #PARAM# e.g. {QUERY "STORED_PROC_NAME '#PARAM1#', '#PARAM2#'"}.

    I would prefer VBA, terrible as it is, to something like this. The only possible thing I can see is that it lets you conditionally show/hide entire paragraphs of text, which I could never figure out how to do in VBA.

  • (cs) in reply to ¯\(°_o)/¯ I DUNNO LOL
    original post:
    “NO” is not a viable option, and the application will generate incorrect documents if “NO” is used.
    I predict that the application will generate incorrect documents no matter which value is used.
  • It's Pat (unregistered)

    Mmmmm, bacon!

  • (cs)

    When dealing with Boolean fields with this macro language, the only value that matters when bacon is involved is..YES.

    (Remy comes through again!)

  • (cs)

    Null's not a value!!!

  • eVil (unregistered) in reply to Tim
    Tim:
    here's my favourite - described as a "tri-state Boolean" - but with 5 possible values!

    http://msdn.microsoft.com/en-us/library/office/aa432714(v=office.12).aspx

    So, it's a tri state... with 5 values... of which 3 are not supported, leaving only the 2 booleans as allowable values!

    Sweet.

  • Julius (unregistered)

    These are all the allowed values an import file should support to bless the monkeys bashing on a keyboard. Taken from a support manual from a program I frequently use...


    A Char(5) yes/no indicator can contain the following values: YES TRUE 1 Y

    NO FALSE 0 N

    NULL (space) (null literal) -1


    Any number between -1 and 1 is considered to be fuzzy logic and will be interpreted using rounding errors, which means that 0.5 will either be TRUE or FALSE depending if I set always_round to UP or DOWN.

  • Julius (unregistered)

    These are all the allowed values an import file should support to bless the monkeys bashing on a keyboard. Taken from a support manual from a program I frequently use...


    A Char(5) yes/no indicator can contain the following values: YES TRUE 1 Y

    NO FALSE 0 N

    NULL (space) (null literal) -1


    Any number between -1 and 1 is considered to be fuzzy logic and will be interpreted using rounding errors, which means that 0.5 will either be TRUE or FALSE depending if I set always_round to UP or DOWN.

  • DangerousAmateur (unregistered)

    Boss: "Can you add the exempt feature until tomorrow, yes or no? ... and by the way, 'no' isn't a valid option!" Developer: "Will do exactly as told."

  • nordynerdy (unregistered) in reply to Julius
    Julius:
    Taken from a support manual from a program I frequently use...

    A Char(5) yes/no indicator can contain the following values: YES TRUE 1 Y

    NO FALSE 0 N

    NULL (space) (null literal) -1

    ---

    Ha, I once had to work with a DB that supported boolean values for all those you've list, plus "T" and "F", and both upper and lower case values for each, and "0" and "1" as well as 0 and 1

  • Franky (unregistered)

    dont laugh, I also have an enum (representing service status) in one app which had the values

    Ok, Bad, Slow, NotAvailable, Disabled, Fail, Invalid, [some more]

    for some time. The reason was that someone insane decided it would be a good idea to have the status as a string originally. So the first iteration was combing through every usage (and then some where the property was copied to a variable and passed around and so on) and just copy/pasting every possible comparison or assignment into an enum value ;)

    Now I am down to 4 values (ok, bad, slow and disabled) which cover all cases (and yes, there is a difference between bad and disabled... disabled ~ ignored test, bad ~ failed test)

  • (cs) in reply to ANON
    ANON:
    "NULL - the string" sounds like Comic hero.

    Actually a villain ... ;-)

    http://www.writeups.org/fiche.php?id=434

    l.

  • Anonymous (unregistered)

    “NO” is not a viable option, and the application will generate incorrect documents if “NO” is used.

    -- The real WTF is that the authors seem to think that adding "NO" as a substitute for "FALSE" would be an improvement.

  • bread (unregistered) in reply to ANON
    ANON:
    "NULL - the string" sounds like Comic hero.
    I read it in Mel Brook's voice. "We've got NULL the Integer, NULL the String, NULL the Boolean..and for the kids, NULL the flamethrower!"
  • (cs) in reply to ANON

    Interestingly enough, my daughter was drawing us as superheroes this weekend, and "Null" was my superhero name.

    I'd told her that being immune to all powers and making powers not work around you would be pretty sweet. (I wasn't allowed to take regeneration AGAIN, dad!)

  • (cs) in reply to savar
    savar:
    Null's not a value!!!

    You must get really upset when people talk about the color black.

  • (cs) in reply to nordynerdy
    nordynerdy:
    Ha, I once had to work with a DB that supported boolean values for all those you've list, plus "T" and "F", and both upper and lower case values for each, and "0" and "1" as well as 0 and 1

    Sounds like a bad pick up line.

    "I've got T and F, all I need is U."

  • flyboyfred (unregistered)
    If, however, you put "FILE_NOT_FOUND" in that column, instead of generating a Word document, your computer outputs bacon.

    This didn't work for me. Do I need a special bacon output device for my computer?

  • (cs)

    One can always use the FORTRAN idea of logicals: If the first letter is 'T' the value is true, otherwise it is false.

    While there is no "file not found", this solves quite a few problems.

    Generally, have a bunch of values that are good for one state (true/false), and all others are the other state (false/true). Unfortunately few people understand this concept.

  • (cs) in reply to Tim
    Tim:
    here's my favourite - described as a "tri-state Boolean" - but with 5 possible values!

    http://msdn.microsoft.com/en-us/library/office/aa432714(v=office.12).aspx

    Of which only 2 values are supported. Gads.

  • (cs) in reply to DrPepper
    DrPepper:
    Tim:
    here's my favourite - described as a "tri-state Boolean" - but with 5 possible values!

    http://msdn.microsoft.com/en-us/library/office/aa432714(v=office.12).aspx

    Of which only 2 values are supported. Gads.

    Clearly the WTF there is VB using -1 for True.

  • (cs) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    DrPepper:
    Tim:
    here's my favourite - described as a "tri-state Boolean" - but with 5 possible values!

    http://msdn.microsoft.com/en-us/library/office/aa432714(v=office.12).aspx

    Of which only 2 values are supported. Gads.

    Clearly the WTF there is VBA using -1 for True.

    FTFY

  • (cs) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    If you bool it, they will come!
    I'm definitely boo(l)ing this code.
  • (cs)

    They're shouting "Bool-urns."

  • (cs) in reply to chubertdev
    chubertdev:
    savar:
    Null's not a value!!!

    You must get really upset when people talk about the color black.

    If anyone thinks black isn't a colour, then they fail to understand what colour is... namely a label applied to some aspect of the human perception of light.

    Secondarily there might be definitions of specific colours that are based on specific bands of wavelengths, but those definitions are calibrated by the human eye. Red might be defined as anything in the ~620–740nm range, but we call it red because it looks red.

    Anyone who doesn't think black is a colour deserves to have everything they own painted black, until they learn that it very much is a colour, and a really bad one for wallpaper, windshields, tins-of-food-in-cupboards, etc...

Leave a comment on “Fields of Booleans”

Log In or post as a guest

Replying to comment #:

« Return to Article