Process.Start not working within if statement

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 1396 Views - Last Post: 30 January 2013 - 09:49 AM Rate Topic: -----

#16 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3576
  • View blog
  • Posts: 11,121
  • Joined: 05-May 12

Re: Process.Start not working within if statement

Posted 30 January 2013 - 06:48 AM

No worries. I know your intent was good. I think that you were trying to steer people towards taking advantage of what the language or compiler supports. For example, given:
uint ComputeIQ(uint age)
{
    :
}


There is never a need to check for a negative like:
uint ComputeIQ(uint age)
{
    if (age < 0)
        throw new ArgumentOutOfRangeException("age");
    :
}


Was This Post Helpful? 0
  • +
  • -

#17 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2263
  • View blog
  • Posts: 9,467
  • Joined: 29-May 08

Re: Process.Start not working within if statement

Posted 30 January 2013 - 08:59 AM

Or use the MayBe type or Option(Of T) that can be use for both reference and value type.

A major to using the Unsigned version of the types is that literals 101 are parsed as a sequence of numberical characters but interepted as the type integer not as a UInt. So you constantly have to cast them.

This post has been edited by AdamSpeight2008: 30 January 2013 - 09:03 AM

Was This Post Helpful? 0
  • +
  • -

#18 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3576
  • View blog
  • Posts: 11,121
  • Joined: 05-May 12

Re: Process.Start not working within if statement

Posted 30 January 2013 - 09:49 AM

Do you have any links to those types where I can learn more about them? My google-fu is weak and I am only finding Option(of T) for F#, and running into too many hits for MayBe.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2