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. And I will show you how deep the rabbit hole runs !!!

And I will show you how deep the rabbit hole runs !!!

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpannouncement
11 Posts 10 Posters 0 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.
  • V virang_21

    While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

    IF printer_type = 1 then
    * ELECTRIC LABEL
    IF ALLTRIM(lin_array(2)) = "ENVIRO" then
    DO eleclabv4
    ELSE
    DO eleclabv1
    ENDIF

    * label form testlab noconsole TO PRINTER
    ELSE
    IF printer_type = 2 then
    * GAS LABEL
    DO gaslabv1
    ELSE
    IF printer_type = 3 then
    SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
    DO echnlabv1
    ELSE
    IF printer_type = 4 then
    DO gaslabv2
    ELSE
    IF printer_type = 5 then
    *Sunpro gas
    DO gaslabv3
    ELSE
    IF printer_type = 6 then
    *Sunpro electric
    DO gaslabv3
    ELSE
    IF printer_type = 7 then
    * Titan
    DO eleclabv2
    ELSE
    IF printer_type = 8 then
    * Centaur
    DO eleclabv3
    ELSE
    IF printer_type = 9 then
    * GEneric label
    DO genlabelele
    ELSE
    IF printer_type = 10 then
    * GEneric label
    DO genlabelgas
    ELSE
    IF printer_type = 11 then
    * Revision D Electric label
    DO genlabeleleRevD
    ELSE
    IF printer_type = 12 then
    * Revision D Electric label
    DO genlabelgasRevD
    ELSE
    IF printer_type = 13 then
    * Revision D Electric label
    DO conergyelec
    ELSE
    IF printer_type = 15 then
    * Therman electric label
    DO genlabeleleThermann
    ELSE
    IF printer_type = 16 then
    * Therman electric label
    DO genlabeleleChina2
    ELSE
    IF printer_type = 17 then
    * H4047 A version label
    DO eleclabv5
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    ENDIF

    Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

    _ Offline
    _ Offline
    _Damian S_
    wrote on last edited by
    #2

    Hey, at least they tabbed it in nicely for you!! :doh:

    Quad skating his way through the world since the early 80's... Booger Mobile - My bright green 1964 Ford Falcon - check out the blog here!! | If you feel generous - make a donation to Camp Quality!!

    1 Reply Last reply
    0
    • V virang_21

      While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

      IF printer_type = 1 then
      * ELECTRIC LABEL
      IF ALLTRIM(lin_array(2)) = "ENVIRO" then
      DO eleclabv4
      ELSE
      DO eleclabv1
      ENDIF

      * label form testlab noconsole TO PRINTER
      ELSE
      IF printer_type = 2 then
      * GAS LABEL
      DO gaslabv1
      ELSE
      IF printer_type = 3 then
      SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
      DO echnlabv1
      ELSE
      IF printer_type = 4 then
      DO gaslabv2
      ELSE
      IF printer_type = 5 then
      *Sunpro gas
      DO gaslabv3
      ELSE
      IF printer_type = 6 then
      *Sunpro electric
      DO gaslabv3
      ELSE
      IF printer_type = 7 then
      * Titan
      DO eleclabv2
      ELSE
      IF printer_type = 8 then
      * Centaur
      DO eleclabv3
      ELSE
      IF printer_type = 9 then
      * GEneric label
      DO genlabelele
      ELSE
      IF printer_type = 10 then
      * GEneric label
      DO genlabelgas
      ELSE
      IF printer_type = 11 then
      * Revision D Electric label
      DO genlabeleleRevD
      ELSE
      IF printer_type = 12 then
      * Revision D Electric label
      DO genlabelgasRevD
      ELSE
      IF printer_type = 13 then
      * Revision D Electric label
      DO conergyelec
      ELSE
      IF printer_type = 15 then
      * Therman electric label
      DO genlabeleleThermann
      ELSE
      IF printer_type = 16 then
      * Therman electric label
      DO genlabeleleChina2
      ELSE
      IF printer_type = 17 then
      * H4047 A version label
      DO eleclabv5
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      ENDIF
      ENDIF
      ENDIF
      ENDIF
      ENDIF
      ENDIF

      Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

      D Offline
      D Offline
      Dennis E White
      wrote on last edited by
      #3

      :omg: give me the blue pill!!!

      you want something inspirational??

      1 Reply Last reply
      0
      • V virang_21

        While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

        IF printer_type = 1 then
        * ELECTRIC LABEL
        IF ALLTRIM(lin_array(2)) = "ENVIRO" then
        DO eleclabv4
        ELSE
        DO eleclabv1
        ENDIF

        * label form testlab noconsole TO PRINTER
        ELSE
        IF printer_type = 2 then
        * GAS LABEL
        DO gaslabv1
        ELSE
        IF printer_type = 3 then
        SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
        DO echnlabv1
        ELSE
        IF printer_type = 4 then
        DO gaslabv2
        ELSE
        IF printer_type = 5 then
        *Sunpro gas
        DO gaslabv3
        ELSE
        IF printer_type = 6 then
        *Sunpro electric
        DO gaslabv3
        ELSE
        IF printer_type = 7 then
        * Titan
        DO eleclabv2
        ELSE
        IF printer_type = 8 then
        * Centaur
        DO eleclabv3
        ELSE
        IF printer_type = 9 then
        * GEneric label
        DO genlabelele
        ELSE
        IF printer_type = 10 then
        * GEneric label
        DO genlabelgas
        ELSE
        IF printer_type = 11 then
        * Revision D Electric label
        DO genlabeleleRevD
        ELSE
        IF printer_type = 12 then
        * Revision D Electric label
        DO genlabelgasRevD
        ELSE
        IF printer_type = 13 then
        * Revision D Electric label
        DO conergyelec
        ELSE
        IF printer_type = 15 then
        * Therman electric label
        DO genlabeleleThermann
        ELSE
        IF printer_type = 16 then
        * Therman electric label
        DO genlabeleleChina2
        ELSE
        IF printer_type = 17 then
        * H4047 A version label
        DO eleclabv5
        endif
        endif
        endif
        endif
        endif
        endif
        endif
        endif
        endif
        endif
        ENDIF
        ENDIF
        ENDIF
        ENDIF
        ENDIF
        ENDIF

        Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

        R Offline
        R Offline
        Ron Beyer
        wrote on last edited by
        #4

        Apparently he had no idea what DO CASE ENDCASE was, unless I'm not reading it right and it really does need to be nested...

        N 1 Reply Last reply
        0
        • V virang_21

          While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

          IF printer_type = 1 then
          * ELECTRIC LABEL
          IF ALLTRIM(lin_array(2)) = "ENVIRO" then
          DO eleclabv4
          ELSE
          DO eleclabv1
          ENDIF

          * label form testlab noconsole TO PRINTER
          ELSE
          IF printer_type = 2 then
          * GAS LABEL
          DO gaslabv1
          ELSE
          IF printer_type = 3 then
          SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
          DO echnlabv1
          ELSE
          IF printer_type = 4 then
          DO gaslabv2
          ELSE
          IF printer_type = 5 then
          *Sunpro gas
          DO gaslabv3
          ELSE
          IF printer_type = 6 then
          *Sunpro electric
          DO gaslabv3
          ELSE
          IF printer_type = 7 then
          * Titan
          DO eleclabv2
          ELSE
          IF printer_type = 8 then
          * Centaur
          DO eleclabv3
          ELSE
          IF printer_type = 9 then
          * GEneric label
          DO genlabelele
          ELSE
          IF printer_type = 10 then
          * GEneric label
          DO genlabelgas
          ELSE
          IF printer_type = 11 then
          * Revision D Electric label
          DO genlabeleleRevD
          ELSE
          IF printer_type = 12 then
          * Revision D Electric label
          DO genlabelgasRevD
          ELSE
          IF printer_type = 13 then
          * Revision D Electric label
          DO conergyelec
          ELSE
          IF printer_type = 15 then
          * Therman electric label
          DO genlabeleleThermann
          ELSE
          IF printer_type = 16 then
          * Therman electric label
          DO genlabeleleChina2
          ELSE
          IF printer_type = 17 then
          * H4047 A version label
          DO eleclabv5
          endif
          endif
          endif
          endif
          endif
          endif
          endif
          endif
          endif
          endif
          ENDIF
          ENDIF
          ENDIF
          ENDIF
          ENDIF
          ENDIF

          Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

          V Offline
          V Offline
          vonb
          wrote on last edited by
          #5

          Looks like a fallen tree..

          The signature is in building process.. Please wait...

          1 Reply Last reply
          0
          • V virang_21

            While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

            IF printer_type = 1 then
            * ELECTRIC LABEL
            IF ALLTRIM(lin_array(2)) = "ENVIRO" then
            DO eleclabv4
            ELSE
            DO eleclabv1
            ENDIF

            * label form testlab noconsole TO PRINTER
            ELSE
            IF printer_type = 2 then
            * GAS LABEL
            DO gaslabv1
            ELSE
            IF printer_type = 3 then
            SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
            DO echnlabv1
            ELSE
            IF printer_type = 4 then
            DO gaslabv2
            ELSE
            IF printer_type = 5 then
            *Sunpro gas
            DO gaslabv3
            ELSE
            IF printer_type = 6 then
            *Sunpro electric
            DO gaslabv3
            ELSE
            IF printer_type = 7 then
            * Titan
            DO eleclabv2
            ELSE
            IF printer_type = 8 then
            * Centaur
            DO eleclabv3
            ELSE
            IF printer_type = 9 then
            * GEneric label
            DO genlabelele
            ELSE
            IF printer_type = 10 then
            * GEneric label
            DO genlabelgas
            ELSE
            IF printer_type = 11 then
            * Revision D Electric label
            DO genlabeleleRevD
            ELSE
            IF printer_type = 12 then
            * Revision D Electric label
            DO genlabelgasRevD
            ELSE
            IF printer_type = 13 then
            * Revision D Electric label
            DO conergyelec
            ELSE
            IF printer_type = 15 then
            * Therman electric label
            DO genlabeleleThermann
            ELSE
            IF printer_type = 16 then
            * Therman electric label
            DO genlabeleleChina2
            ELSE
            IF printer_type = 17 then
            * H4047 A version label
            DO eleclabv5
            endif
            endif
            endif
            endif
            endif
            endif
            endif
            endif
            endif
            endif
            ENDIF
            ENDIF
            ENDIF
            ENDIF
            ENDIF
            ENDIF

            Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

            H Offline
            H Offline
            hansoctantan
            wrote on last edited by
            #6

            that code sure is a pain in a neck :omg:

            What???

            1 Reply Last reply
            0
            • R Ron Beyer

              Apparently he had no idea what DO CASE ENDCASE was, unless I'm not reading it right and it really does need to be nested...

              N Offline
              N Offline
              Nagy Vilmos
              wrote on last edited by
              #7

              I hath been through it, it can be a simple CASE block.

              Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow

              K 1 Reply Last reply
              0
              • V virang_21

                While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

                IF printer_type = 1 then
                * ELECTRIC LABEL
                IF ALLTRIM(lin_array(2)) = "ENVIRO" then
                DO eleclabv4
                ELSE
                DO eleclabv1
                ENDIF

                * label form testlab noconsole TO PRINTER
                ELSE
                IF printer_type = 2 then
                * GAS LABEL
                DO gaslabv1
                ELSE
                IF printer_type = 3 then
                SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
                DO echnlabv1
                ELSE
                IF printer_type = 4 then
                DO gaslabv2
                ELSE
                IF printer_type = 5 then
                *Sunpro gas
                DO gaslabv3
                ELSE
                IF printer_type = 6 then
                *Sunpro electric
                DO gaslabv3
                ELSE
                IF printer_type = 7 then
                * Titan
                DO eleclabv2
                ELSE
                IF printer_type = 8 then
                * Centaur
                DO eleclabv3
                ELSE
                IF printer_type = 9 then
                * GEneric label
                DO genlabelele
                ELSE
                IF printer_type = 10 then
                * GEneric label
                DO genlabelgas
                ELSE
                IF printer_type = 11 then
                * Revision D Electric label
                DO genlabeleleRevD
                ELSE
                IF printer_type = 12 then
                * Revision D Electric label
                DO genlabelgasRevD
                ELSE
                IF printer_type = 13 then
                * Revision D Electric label
                DO conergyelec
                ELSE
                IF printer_type = 15 then
                * Therman electric label
                DO genlabeleleThermann
                ELSE
                IF printer_type = 16 then
                * Therman electric label
                DO genlabeleleChina2
                ELSE
                IF printer_type = 17 then
                * H4047 A version label
                DO eleclabv5
                endif
                endif
                endif
                endif
                endif
                endif
                endif
                endif
                endif
                endif
                ENDIF
                ENDIF
                ENDIF
                ENDIF
                ENDIF
                ENDIF

                Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

                K Offline
                K Offline
                Killzone DeathMan
                wrote on last edited by
                #8

                "Zen and the art of software maintenance : rm -rf * " - The best maintenance ever :laugh: :laugh: :laugh:

                1 Reply Last reply
                0
                • N Nagy Vilmos

                  I hath been through it, it can be a simple CASE block.

                  Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow

                  K Offline
                  K Offline
                  Killzone DeathMan
                  wrote on last edited by
                  #9

                  Agree!!! ;P

                  1 Reply Last reply
                  0
                  • V virang_21

                    While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

                    IF printer_type = 1 then
                    * ELECTRIC LABEL
                    IF ALLTRIM(lin_array(2)) = "ENVIRO" then
                    DO eleclabv4
                    ELSE
                    DO eleclabv1
                    ENDIF

                    * label form testlab noconsole TO PRINTER
                    ELSE
                    IF printer_type = 2 then
                    * GAS LABEL
                    DO gaslabv1
                    ELSE
                    IF printer_type = 3 then
                    SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
                    DO echnlabv1
                    ELSE
                    IF printer_type = 4 then
                    DO gaslabv2
                    ELSE
                    IF printer_type = 5 then
                    *Sunpro gas
                    DO gaslabv3
                    ELSE
                    IF printer_type = 6 then
                    *Sunpro electric
                    DO gaslabv3
                    ELSE
                    IF printer_type = 7 then
                    * Titan
                    DO eleclabv2
                    ELSE
                    IF printer_type = 8 then
                    * Centaur
                    DO eleclabv3
                    ELSE
                    IF printer_type = 9 then
                    * GEneric label
                    DO genlabelele
                    ELSE
                    IF printer_type = 10 then
                    * GEneric label
                    DO genlabelgas
                    ELSE
                    IF printer_type = 11 then
                    * Revision D Electric label
                    DO genlabeleleRevD
                    ELSE
                    IF printer_type = 12 then
                    * Revision D Electric label
                    DO genlabelgasRevD
                    ELSE
                    IF printer_type = 13 then
                    * Revision D Electric label
                    DO conergyelec
                    ELSE
                    IF printer_type = 15 then
                    * Therman electric label
                    DO genlabeleleThermann
                    ELSE
                    IF printer_type = 16 then
                    * Therman electric label
                    DO genlabeleleChina2
                    ELSE
                    IF printer_type = 17 then
                    * H4047 A version label
                    DO eleclabv5
                    endif
                    endif
                    endif
                    endif
                    endif
                    endif
                    endif
                    endif
                    endif
                    endif
                    ENDIF
                    ENDIF
                    ENDIF
                    ENDIF
                    ENDIF
                    ENDIF

                    Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

                    L Offline
                    L Offline
                    Lutoslaw
                    wrote on last edited by
                    #10

                    I think you shouldn't change this code... You could angry the titans and centaurs who can ignite some gas using an electric cable. You will end up with a label with a printed "ownd by Therman, the undead coder". I warned you, mortal.

                    Greetings - Jacek

                    1 Reply Last reply
                    0
                    • V virang_21

                      While converting old FoxPro project to new .NET solution.. This is what I am putting up with... :(

                      IF printer_type = 1 then
                      * ELECTRIC LABEL
                      IF ALLTRIM(lin_array(2)) = "ENVIRO" then
                      DO eleclabv4
                      ELSE
                      DO eleclabv1
                      ENDIF

                      * label form testlab noconsole TO PRINTER
                      ELSE
                      IF printer_type = 2 then
                      * GAS LABEL
                      DO gaslabv1
                      ELSE
                      IF printer_type = 3 then
                      SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
                      DO echnlabv1
                      ELSE
                      IF printer_type = 4 then
                      DO gaslabv2
                      ELSE
                      IF printer_type = 5 then
                      *Sunpro gas
                      DO gaslabv3
                      ELSE
                      IF printer_type = 6 then
                      *Sunpro electric
                      DO gaslabv3
                      ELSE
                      IF printer_type = 7 then
                      * Titan
                      DO eleclabv2
                      ELSE
                      IF printer_type = 8 then
                      * Centaur
                      DO eleclabv3
                      ELSE
                      IF printer_type = 9 then
                      * GEneric label
                      DO genlabelele
                      ELSE
                      IF printer_type = 10 then
                      * GEneric label
                      DO genlabelgas
                      ELSE
                      IF printer_type = 11 then
                      * Revision D Electric label
                      DO genlabeleleRevD
                      ELSE
                      IF printer_type = 12 then
                      * Revision D Electric label
                      DO genlabelgasRevD
                      ELSE
                      IF printer_type = 13 then
                      * Revision D Electric label
                      DO conergyelec
                      ELSE
                      IF printer_type = 15 then
                      * Therman electric label
                      DO genlabeleleThermann
                      ELSE
                      IF printer_type = 16 then
                      * Therman electric label
                      DO genlabeleleChina2
                      ELSE
                      IF printer_type = 17 then
                      * H4047 A version label
                      DO eleclabv5
                      endif
                      endif
                      endif
                      endif
                      endif
                      endif
                      endif
                      endif
                      endif
                      endif
                      ENDIF
                      ENDIF
                      ENDIF
                      ENDIF
                      ENDIF
                      ENDIF

                      Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.

                      M Offline
                      M Offline
                      MarkTJohnson
                      wrote on last edited by
                      #11

                      At least it works. I once had to rewrite an entire module because it contained more nesting than the Microsoft C 5.1 compiler could handle. Hooray for greenbar tractor feed paper and multiple colored pens. Oh yeah, that code had Goto's in it. Not only the normal backwards ones, but forward ones too. X|

                      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