Results 1 to 4 of 4

Thread: [RESOLVED] Custom Functions Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Location
    Scotland
    Posts
    417

    Resolved [RESOLVED] Custom Functions Question

    Hi Guys,

    I'm just curious, when writing your functions, do you need to put a try/catch in them? or does it not really matter?

    thanks guys

    Graham

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: Custom Functions Question

    Sometimes I do and if it Catches an error, I have the function return some error value like -1. Otherwise, I let the parent Subroutine that's calling the function trap the error.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Custom Functions Question

    Quote Originally Posted by graham23s View Post
    Hi Guys,

    I'm just curious, when writing your functions, do you need to put a try/catch in them? or does it not really matter?

    thanks guys

    Graham
    It depends on what the function is doing, and if there is a possibility of it throwing an exception or not.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Location
    Scotland
    Posts
    417

    Re: Custom Functions Question

    ah thanks guys, as a rule of thumb i'll leave them out.

    cheers guys

    Graham

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width