473,394 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
Oct 23 '07 #1
2 2187
JosAH
11,448 Expert 8TB
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
Oct 23 '07 #2
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
Oct 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

28
by: Fábio Mendes | last post by:
I'm sorry if it's an replicate. Either my e-mail program is messing with things or the python-list sent my msg to /dev/null. I couldn't find anything related in previous PEP's, so here it goes a...
10
by: jeff regoord | last post by:
A user inputs a float value. The scanf() function gets the value. However, I need to create an error handler with an if else statement saying invalid input if the input is not a number. Does...
5
by: charliewest | last post by:
I've implemented the USING statement to ensure that my newly created sql connection closes when my method is finished using it. The USING statement is wrapped in try/catch error handling statement....
6
by: Arjen | last post by:
Hi, I'm reading the enterprise library documentation and there I see the throw statement. try { // run code } catch(Exception ex) {
4
by: Steve | last post by:
Hi All In VB6 I used to catch exceptions in a goto errtrap call then resume if I could handle the problem and continue within the routine or function I am not sure how to do this in VB 2005...
2
by: Macca | last post by:
Hi, I have a switch statement that has 5+ case statements. Each of these case statements copies form one array to another. Rather than doing a separate try..catch statement for each case...
2
by: Bit byte | last post by:
I have a simplistic exception class like so: class CommException { public: CommException(const char *err){ strncpy(msg,err,ERR_MSG_LEN); } virtual ~CommException(){;} void erase(void) {...
12
by: reycri | last post by:
While the following is allowed: if (a == b) SomeFunction(); else OtherFunction(); The following is not: try
9
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I have a class with an collection property. The collection property is sometimes equal to nothing. The class has a function named 'Exists' which returns TRUE if the specified string exists...
4
by: robtyketto | last post by:
Greetings, I've got my head spinning with some very simple java coding, Im a newbie to Java and utilising the code below for a javabean for some jsp Im working on. The problem is my code I've...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.