If Statement in Try Catch Statement??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnnetteB
    New Member
    • Oct 2007
    • 10

    If Statement in Try Catch Statement??

    I have an action performed on the click of a button which basically opens up a text file based on the textfield input of the user. I would like to use an if statement to say if the variable already exists to give a message saying file name already used. I didn't want to use file reader as I wanted to specify the exact location of the files.

    I have put an if statement inside the try catch of the action performed, but it won't work?? Can anyone explain where I am going wrong?

    Thanks.

    Annette
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by AnnetteB
    I have put an if statement inside the try catch of the action performed, but it won't work?? Can anyone explain where I am going wrong?

    Thanks.

    Annette
    No sorry; Tuesday is not my psychic day. What doesn't work? Doesn't it compile?
    Maybe you should post the relevant piece of code (not your entire class please)
    and don't forget to use those code tags. (also see the little window to the right
    of the edit window when you compose your reply.

    kind regards,

    Jos

    Comment

    • AnnetteB
      New Member
      • Oct 2007
      • 10

      #3
      Originally posted by JosAH
      No sorry; Tuesday is not my psychic day. What doesn't work? Doesn't it compile?
      Maybe you should post the relevant piece of code not your entire class please)
      and don't forget to use those code tags. (also see the little window to the right
      of the edit window when you compose your reply.

      kind regards,

      Jos
      Thanks! I will post the snippet of code that isn't compiling and try and be more specific with the wording of my question next time.

      Thanks.

      Annette

      Comment

      Working...