Click here to Skip to main content

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralLoading custom fields from Quickbooks [modified]memberJeremy D Lee9 Nov '12 - 16:01 
99% of the time,
customer.DataExtRetList != null
. This was supposed to fix the edge cases when
customer.DataExtRetList == null
.
 
if (customer.DataExtRetList != null) {
  this.QBInfo.DateCatSent = "";
  this.Source = "";
} else {
  for (int i = 0; i < customer.DataExtRetList.Count; i++) {
    IDataExtRet ext = customer.DataExtRetList.GetAt(i);
    if (ext.DataExtName.GetValueOrEmpty() == "Date Cat. Sent")
      this.QBInfo.DateCatSent = ext.DataExtValue.GetValueOrEmpty();
    else if (ext.DataExtName.GetValueOrEmpty() == "Source")
      this.Source = ext.DataExtValue.GetValueOrEmpty();
  }
}


modified 9 Nov '12 - 22:35.

JokeRe: Loading custom fields from QuickbooksmemberBernhard Hiller10 Nov '12 - 21:53 
Daer frnds,
need help urgenz. Most time my code simply not work. Sometime it give errro refernce not setting object. Plz help its urgentz.
GeneralRe: Loading custom fields from QuickbooksmemberJeremy D Lee11 Nov '12 - 2:14 
Why do you think I posted it in this forum? Did you miss the mistake? Smile | :)
GeneralRe: Loading custom fields from QuickbooksmemberBernhard Hiller11 Nov '12 - 21:33 
And do you see that I marked it as a joke? Oh dear, I know the meaning of this forum, and I saw the problems the code snippet causes. And I posted like someone would do who uses to write such code. That seems to be beyond the joking capacity of an average CP member though, as can be deduced from the votes...
GeneralRe: Loading custom fields from QuickbooksmemberZac Greve11 Nov '12 - 5:34 
Ouch.
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking

GeneralRe: Loading custom fields from QuickbooksmemberBobJanova12 Nov '12 - 22:15 
That is a level of fail which leaves me speechless.
GeneralRe: Loading custom fields from QuickbooksmemberClodetta del Mar15 Nov '12 - 1:37 
I can do it even better ...
Yesterday I found that gem in my own code
Boolean deleted = false;
if(deleted){
...
}
what a great luck I wrote it only five minutes before I observed my supersophisticated State-of-the-art-Failure... Big Grin | :-D

Blush | :O

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 24 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid