Click here to Skip to main content
15,886,603 members
Home / Discussions / C#
   

C#

 
AnswerRe: Wah Wah effect for guitar Pin
MarkRHolbrook11-Aug-13 4:04
MarkRHolbrook11-Aug-13 4:04 
GeneralAdding digital signature in Crystal report pdf Pin
gandhipurvi6-Aug-13 0:25
gandhipurvi6-Aug-13 0:25 
GeneralRe: Adding digital signature in Crystal report pdf Pin
Ennis Ray Lynch, Jr.6-Aug-13 2:55
Ennis Ray Lynch, Jr.6-Aug-13 2:55 
QuestionDatetime parsing Pin
ExcellentOrg5-Aug-13 21:58
ExcellentOrg5-Aug-13 21:58 
AnswerRe: Datetime parsing Pin
Richard MacCutchan5-Aug-13 22:58
mveRichard MacCutchan5-Aug-13 22:58 
GeneralRe: Datetime parsing Pin
ExcellentOrg5-Aug-13 23:30
ExcellentOrg5-Aug-13 23:30 
AnswerRe: Datetime parsing Pin
Richard MacCutchan6-Aug-13 0:04
mveRichard MacCutchan6-Aug-13 0:04 
GeneralRe: Datetime parsing Pin
ExcellentOrg6-Aug-13 9:19
ExcellentOrg6-Aug-13 9:19 
Richard MacCutchan wrote:
You are testing the value of formatFailed in your try block, but you set it inside the catch block. This is not the way to code a try catch sequence. You should be displaying the failure message in the catch block, and break out of the loop only when the parsing succeeds.


Richard

Actual code of the function is 150-200 lines with lots of Reflection and stuff. I had only posted tail portion of code which was the problem area. What happens is as follows. For each field, I have custom attribute that spells out what format is going to be present which I call tryFirstFormat. So, there is one another parseexact before code enters loop. If it enters the loop, it is 100% certain that formatFailed will be set to 1. Fortunately, C# will not let me compile without initialized variable antway.

Lastly, Message that gets logged inside try block is actually to report a successful parse after blah-blah number of attempts. Message in catch block is when parsing fails where attempt count increases

Tonight, I spent time thumbing thru few other sites and decided to change the loop index (i) to be a volatile member of class Will discover how this performs tomorrow.
AnswerRe: Datetime parsing Pin
Richard MacCutchan6-Aug-13 0:09
mveRichard MacCutchan6-Aug-13 0:09 
GeneralRe: Datetime parsing Pin
ExcellentOrg6-Aug-13 9:10
ExcellentOrg6-Aug-13 9:10 
AnswerRe: Datetime parsing Pin
Mycroft Holmes6-Aug-13 12:56
professionalMycroft Holmes6-Aug-13 12:56 
GeneralRe: Datetime parsing Pin
ExcellentOrg6-Aug-13 18:52
ExcellentOrg6-Aug-13 18:52 
AnswerRe: Datetime parsing Pin
ExcellentOrg7-Aug-13 7:57
ExcellentOrg7-Aug-13 7:57 
QuestionHow to convert string to form object in c# window application Pin
susanna.floora5-Aug-13 21:37
susanna.floora5-Aug-13 21:37 
AnswerRe: How to convert string to form object in c# window application Pin
ExcellentOrg5-Aug-13 22:34
ExcellentOrg5-Aug-13 22:34 
AnswerRe: How to convert string to form object in c# window application Pin
Rizny Mubarak5-Aug-13 23:43
Rizny Mubarak5-Aug-13 23:43 
QuestionRe: How to convert string to form object in c# window application Pin
Eddy Vluggen6-Aug-13 7:47
professionalEddy Vluggen6-Aug-13 7:47 
AnswerRe: How to convert string to form object in c# window application Pin
susanna.floora7-Aug-13 19:07
susanna.floora7-Aug-13 19:07 
AnswerRe: How to convert string to form object in c# window application Pin
ExcellentOrg6-Aug-13 9:22
ExcellentOrg6-Aug-13 9:22 
AnswerRe: How to convert string to form object in c# window application Pin
Jean A Brandelero8-Aug-13 10:45
Jean A Brandelero8-Aug-13 10:45 
GeneralRe: How to convert string to form object in c# window application Pin
susanna.floora9-Aug-13 2:02
susanna.floora9-Aug-13 2:02 
GeneralRe: How to convert string to form object in c# window application Pin
Jean A Brandelero9-Aug-13 7:51
Jean A Brandelero9-Aug-13 7:51 
AnswerRe: How to convert string to form object in c# window application Pin
BillWoodruff11-Aug-13 0:13
professionalBillWoodruff11-Aug-13 0:13 
GeneralRe: How to convert string to form object in c# window application Pin
susanna.floora26-Aug-13 21:47
susanna.floora26-Aug-13 21:47 
QuestionAutocomplete TextBox no find other words in string Pin
juliogyn5-Aug-13 16:49
juliogyn5-Aug-13 16:49 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.