Results 1 to 2 of 2

Thread: looking for the righ tException

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    looking for the righ tException

    my function is expecting a 2D array which will have 5 elements in each dimension. I want to throw an exception if there are fewer, or more than 5 elements in any dimension. Any suggestions on which exception I should throw? the ArgumentException works in general, but I was wondering if there was a better choice... it's just a stupid question
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Junior Member
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    27
    I'm not sure if you want to try this, but you can anticipate the Ex.Message ... If it says something like "Index outside the bounds of the Array... Blablabla" you can make an If...Then block that you can use to select a message that you can show to the user... ( ? )

    Hope it helps...
    *(^.^); c(_)

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