Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-01-2008, 08:59 PM   PM User | #1
Inquisit
New Coder

 
Join Date: Aug 2008
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Inquisit is an unknown quantity at this point
Question error detection how to detect

Question

ive encountered a little challenge

ive tried to make my program detect an error

i.e such as NaN and then it displays a message dialog saying Syntax error

the problem is this works but the dialog keeps poping up when simple arithmetics are performed with proper answers NaN and Infinity
what i would like to achieve is just NaN or Infinity etc detected not everything

i.e
txtNumber1 ......N1
txtNumber2

sum=N1+N2

Answer=value of (sum);

i want the dialog to appear when Nan or Infinit appears in the Answer text
ive tried if but fails to detect it

i.e

if (sum).equals("NaN");
Messadialog appears saying syntax, math etc errors

||

if (sum).equals("Infinity");

Messadialog appears saying syntax, math etc errors user presses OK then refreshes the panel


this is where your expertise fits in

thanks
Inquisit is offline   Reply With Quote
Old 09-02-2008, 01:31 AM   PM User | #2
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
You might want to specify what language you are using.
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 09-02-2008, 09:28 AM   PM User | #3
Inquisit
New Coder

 
Join Date: Aug 2008
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Inquisit is an unknown quantity at this point
java

NetBeans 5
Inquisit is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:47 PM.


Advertisement
Log in to turn off these ads.