Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Handling "Special" Cases in "Special" Ways

Handling "Special" Cases in "Special" Ways

Scheduled Pinned Locked Moved The Weird and The Wonderful
com
5 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #1

    A sample of the code I'm working on now:

    TimeZone = If(item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value <> "", item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value, "")

    In short, set the result to the value when the value is not an empty string; otherwise, set the result to an empty string. :((

    Thou mewling ill-breeding pignut!

    P P 3 Replies Last reply
    0
    • A AspDotNetDev

      A sample of the code I'm working on now:

      TimeZone = If(item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value <> "", item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value, "")

      In short, set the result to the value when the value is not an empty string; otherwise, set the result to an empty string. :((

      Thou mewling ill-breeding pignut!

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      What language is that?

      R 1 Reply Last reply
      0
      • P PIEBALDconsult

        What language is that?

        R Offline
        R Offline
        Robert Rohde
        wrote on last edited by
        #3

        VB.Net

        1 Reply Last reply
        0
        • A AspDotNetDev

          A sample of the code I'm working on now:

          TimeZone = If(item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value <> "", item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value, "")

          In short, set the result to the value when the value is not an empty string; otherwise, set the result to an empty string. :((

          Thou mewling ill-breeding pignut!

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Something similar I catch myself almost writing is along the lines of: if ( x <> y ) x = y :sigh:

          1 Reply Last reply
          0
          • A AspDotNetDev

            A sample of the code I'm working on now:

            TimeZone = If(item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value <> "", item.Descendants("DisplayableDateTime").Attributes("TimeZone").ElementAt(0).Value, "")

            In short, set the result to the value when the value is not an empty string; otherwise, set the result to an empty string. :((

            Thou mewling ill-breeding pignut!

            P Offline
            P Offline
            peterchen
            wrote on last edited by
            #5

            Are you by chance working in a funny language where !(a<>b) does not mean b can be used instead of a in all contexts? Let's say you have a language where null == "" (for simplicity, you know?) Then you have an API that does not follow that convention and throws on a null.

            ORDER BY what user wants

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups