not (true) not (false)

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default not (true) not (false)

    I am having a major brain block. I am reviewing this code and am getting my
    logic confused.

    This is the code:

    <cfif (not refind("\d{3}-\d{3}-\d{4}",form.destinationaddress)) and (not
    refind("\d{10}",form.destinationaddress)) >

    is this correct?
    not(f) and not(f) eq t
    not(t) and not(t) eq f
    not(f) and not(t) eq t ?

    Thanks.

    SilentBob'secretfusion Guest

  2. Similar Questions and Discussions

    1. True or False and why?
      (Contribute CS3 for Windows) A brand new Contributor user gets an account on a web server. There are no files in the directory (no index.htm,...
    2. cfselect and true/false instead of 1/0
      Hi, can any one tell me why does it return the text true and false instead of 1 and 0 for a BIT column of a table from MS SQL Server. I have CFMX...
    3. format true/false
      Hi Webform; bound datagrid. My boolean column shows TRUE or FALSE. I'd rather have a checkbox. How to format please? Thanks Graeme
    4. MSSQL True/False values
      I'm lost at the moment. I have a SQL database that has fields with bit datatypes. This database originated from an Access database and the bit...
  3. #2

    Default Re: not (true) not (false)

    I would just change
    not(f) and not(t) eq t ?
    to
    not(f) and not(t) eq f ?

    not(f) = true
    not(t) = false
    t and f = false (1 and 0 = 0)

    basky Guest

  4. #3

    Default Re: not (true) not (false)

    It's:
    not(f) and not(f) eq t
    not(t) and not(t) eq f
    not(f) and not(t) eq f

    OldCFer Guest

  5. #4

    Default Re: not (true) not (false)

    Change the logic to be:

    if (not (expr1 and expr2));

    It's a lot clearer.

    I have heard - and certainly believe from my own experience - that humans
    struggle with NOTness. So best to minimise the instances of having to do
    it :-)

    --

    Adam
    Adam Cameron Guest

  6. #5

    Default Re: not (true) not (false)

    Or better yet:

    <cfif not refind("\d{3}(-?)\d{3}\1\d{4}",form.destinationaddress)>

    --

    Adam
    Adam Cameron Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139