Worst Coding
-
May I be so bold to suggest a new competition, sorry no prizes here, just satisfaction that you are a good programmer. How about a worst code comp. Heres my entry , found inside Crystal Reports as Page supression, i think you will all get the jist :) -------------------------------------------------------------- if {crNettCrystal.PaxCount} > 36 and pagenumber > 2 then false else if {crNettCrystal.CanxPublishedFareCount} + {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CharterCount} > 2 and pagenumber = 3 then false else if {@SchedCount} = 0 and {@ChartCount} > 2 and pagenumber = 3 then false else // stu if {@SegCount} < 5 and {crNettCrystal.CanxPropCount} + {crNettCrystal.CanxCarHireCount} + {crNettCrystal.CanxSightSeeingCount} + {crNettCrystal.CanxTourCount} < 3 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} + {crNettCrystal.GroundAmendmentCount} < 3 and pagenumber = 3 then true else if {@SegCount} = 4 and {crNettCrystal.GroundAmendmentCount} > 0 and pagenumber =3 then false else if {@SegCount} = 4 and {crNettCrystal.FlightAmendmentCount} = 2 and {@SchedFlightCancCount} = 2 and pagenumber =3 then false else if {@SegCount} = 5 and {crNettCrystal.FlightAmendmentCount} = 2 and pagenumber =3 then false else if {@SegCount} > 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 4 then false else if {@SegCount} < 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 3 then false else if {@SegCount} < 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 4 then false else if {@SegCount} = 3 and {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CanxPublishedFareCount} > 0 and pagenumber = 3 then false else if {@SegCount} = 2 and {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CanxPublishedFareCount} > 0 and pagenumber = 3 then false //else if {@SchedCount} = 0 and {@ChartCount} < 5 and {@Accom} + {@CarCount} < 3 and {@InsCount} >0 and pagenumber = 3 then false else if {@SchedCount} = 0 and {@ChartCount} = 0 and {@Accom} + {@CarCount} < 3 and {crNettCrystal.CanxCarHireCount} > 0 and pagenumber = 3 then false else if {@SegCount} = 5 and {@ChartCount} =0 and {@Accom} + {@CarCount} < 3 and pagenumber > 2 then true // stu else if {@SchedCount} = 0 and {@ChartCount} < 5 and {@Accom} + {@CarCount} < 3 and pagenumber > 2 then true else if {@SegCount} = 9 and {@Accom} =4 and pagenumber = 4 then false else if {@SegCount} = 5 and {@Accom} + {@CarCount} =5 and {@InsCount}
-
May I be so bold to suggest a new competition, sorry no prizes here, just satisfaction that you are a good programmer. How about a worst code comp. Heres my entry , found inside Crystal Reports as Page supression, i think you will all get the jist :) -------------------------------------------------------------- if {crNettCrystal.PaxCount} > 36 and pagenumber > 2 then false else if {crNettCrystal.CanxPublishedFareCount} + {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CharterCount} > 2 and pagenumber = 3 then false else if {@SchedCount} = 0 and {@ChartCount} > 2 and pagenumber = 3 then false else // stu if {@SegCount} < 5 and {crNettCrystal.CanxPropCount} + {crNettCrystal.CanxCarHireCount} + {crNettCrystal.CanxSightSeeingCount} + {crNettCrystal.CanxTourCount} < 3 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} + {crNettCrystal.GroundAmendmentCount} < 3 and pagenumber = 3 then true else if {@SegCount} = 4 and {crNettCrystal.GroundAmendmentCount} > 0 and pagenumber =3 then false else if {@SegCount} = 4 and {crNettCrystal.FlightAmendmentCount} = 2 and {@SchedFlightCancCount} = 2 and pagenumber =3 then false else if {@SegCount} = 5 and {crNettCrystal.FlightAmendmentCount} = 2 and pagenumber =3 then false else if {@SegCount} > 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 4 then false else if {@SegCount} < 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 3 then false else if {@SegCount} < 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 4 then false else if {@SegCount} = 3 and {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CanxPublishedFareCount} > 0 and pagenumber = 3 then false else if {@SegCount} = 2 and {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CanxPublishedFareCount} > 0 and pagenumber = 3 then false //else if {@SchedCount} = 0 and {@ChartCount} < 5 and {@Accom} + {@CarCount} < 3 and {@InsCount} >0 and pagenumber = 3 then false else if {@SchedCount} = 0 and {@ChartCount} = 0 and {@Accom} + {@CarCount} < 3 and {crNettCrystal.CanxCarHireCount} > 0 and pagenumber = 3 then false else if {@SegCount} = 5 and {@ChartCount} =0 and {@Accom} + {@CarCount} < 3 and pagenumber > 2 then true // stu else if {@SchedCount} = 0 and {@ChartCount} < 5 and {@Accom} + {@CarCount} < 3 and pagenumber > 2 then true else if {@SegCount} = 9 and {@Accom} =4 and pagenumber = 4 then false else if {@SegCount} = 5 and {@Accom} + {@CarCount} =5 and {@InsCount}
That gives me a headache X| Cheers, Tom Archer Author - Inside C#, Visual C++.NET Bible
-
May I be so bold to suggest a new competition, sorry no prizes here, just satisfaction that you are a good programmer. How about a worst code comp. Heres my entry , found inside Crystal Reports as Page supression, i think you will all get the jist :) -------------------------------------------------------------- if {crNettCrystal.PaxCount} > 36 and pagenumber > 2 then false else if {crNettCrystal.CanxPublishedFareCount} + {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CharterCount} > 2 and pagenumber = 3 then false else if {@SchedCount} = 0 and {@ChartCount} > 2 and pagenumber = 3 then false else // stu if {@SegCount} < 5 and {crNettCrystal.CanxPropCount} + {crNettCrystal.CanxCarHireCount} + {crNettCrystal.CanxSightSeeingCount} + {crNettCrystal.CanxTourCount} < 3 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} + {crNettCrystal.GroundAmendmentCount} < 3 and pagenumber = 3 then true else if {@SegCount} = 4 and {crNettCrystal.GroundAmendmentCount} > 0 and pagenumber =3 then false else if {@SegCount} = 4 and {crNettCrystal.FlightAmendmentCount} = 2 and {@SchedFlightCancCount} = 2 and pagenumber =3 then false else if {@SegCount} = 5 and {crNettCrystal.FlightAmendmentCount} = 2 and pagenumber =3 then false else if {@SegCount} > 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 4 then false else if {@SegCount} < 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 3 then false else if {@SegCount} < 5 and {@Accom} + {@CarCount} + {@SightSeeCount} + {@TourCount} > 3 and pagenumber = 4 then false else if {@SegCount} = 3 and {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CanxPublishedFareCount} > 0 and pagenumber = 3 then false else if {@SegCount} = 2 and {crNettCrystal.CanxNettFareCount} + {crNettCrystal.CanxPublishedFareCount} > 0 and pagenumber = 3 then false //else if {@SchedCount} = 0 and {@ChartCount} < 5 and {@Accom} + {@CarCount} < 3 and {@InsCount} >0 and pagenumber = 3 then false else if {@SchedCount} = 0 and {@ChartCount} = 0 and {@Accom} + {@CarCount} < 3 and {crNettCrystal.CanxCarHireCount} > 0 and pagenumber = 3 then false else if {@SegCount} = 5 and {@ChartCount} =0 and {@Accom} + {@CarCount} < 3 and pagenumber > 2 then true // stu else if {@SchedCount} = 0 and {@ChartCount} < 5 and {@Accom} + {@CarCount} < 3 and pagenumber > 2 then true else if {@SegCount} = 9 and {@Accom} =4 and pagenumber = 4 then false else if {@SegCount} = 5 and {@Accom} + {@CarCount} =5 and {@InsCount}
I think someone needs to send Crystal Decisions a mail with the subject: code generation shouldn't = code obfuscation. At least they bothered to plug in line breaks. Cheers, Simon "From now on, if rogue states want to buy weapons of mass destruction, they're going to have to go on eBay," Mr. Bezos said.
-
That gives me a headache X| Cheers, Tom Archer Author - Inside C#, Visual C++.NET Bible
Tom Archer wrote: That gives me a headache What gives you a headache... as soon as I open that post I faint and then I wake up and the post has closed.. no idea what's in it. *sigh* Regards, Brian Dela :-)