Re: Assertion on Type conversion

Tech-Archive recommends: Fix windows errors by optimizing your registry



Dave, thanks for the reply.

1- I didn't explain my problem clearly.
2- As you suggested CustomType.Parse has its own exception
3- I am *expecting* that conversion of "someString" to CustomType is
always true.

*post-condition assertion in Design-by-Contract is what I am looking
for*
As you already mentioned all the assertions are checked during the
debug mode, so I was looking for some kind of code that help me to
eliminate the try-catch statement by using an Assert statement.

BTW, if I could kust use "as" statement I could accomplish this task.

.



Relevant Pages

  • Comments on the first week of 2006
    ... in each of Brady's summaries. ... With the exception of Monday's show with ... Heather Graham, Dave seemed ... Prev by Date: ...
    (alt.fan.letterman)
  • Re: binary format S
    ... exception for anything past this: ... This is wierd - surely there is not a limit on the amount of data we ... Prev by Date: ...
    (comp.lang.tcl)
  • Re: Singly Linked LIst and Objects Newbie Question
    ... so you can't fit it into the assert statement ... public class Main ... empty interface that doesn't place any restriction on the call method. ... It surpirised me that you don't have to catch the Exception that's ...
    (comp.lang.java.programmer)
  • Re: [Lit.] Buffer overruns
    ... >>You're making too much of Infobahn's little joke, Dave. ... My apologies. ... I'm used to ignoring spelling because ... > exception. ...
    (sci.crypt)
  • RE: Any solution yet for ... menu objects losing their connection
    ... always throw an exception. ... thanks - dave ... > So far for the problem similar with your scenario, ... > This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.office.developer.com.add_ins)