Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving Error  RSS feed

 
Karen Baog
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again guys!

Here's a problem with saving a file.
If, for example, the user makes the mistake of typing more than two '.' as a filename and nothing else it results to tons of error.
If I use valind filename it's OK.

Example code:




How is this catched if I use a try-catch block? Or better still, how do I prevent this from happening?
I tried the same test on Word/Wordpad and the way it behaves is that it doesn't do anything.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!