And I will show you how deep the rabbit hole runs !!!
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
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!!
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
:omg: give me the blue pill!!!
you want something inspirational??
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
that code sure is a pain in a neck :omg:
What???
-
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...
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
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
"Zen and the art of software maintenance : rm -rf * " - The best maintenance ever :laugh: :laugh: :laugh:
-
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
Agree!!! ;P
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
-
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
ENDIFZen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
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|