[frgeek-michiana] Re: Java code help

  • From: chuq <chuq00@xxxxxxxxx>
  • To: frgeek-michiana@xxxxxxxxxxxxx
  • Date: Sat, 25 Sep 2010 21:32:01 -0400

Ok now I am getting confused a bit here.
http://pastebin.com/7yDzgwaS
if anyone can I would appreciate it

chuq

On Sat, 2010-09-25 at 07:57 -0400, Tony Germano wrote:
> Fr. Robert has the right idea. In Java you actually want to put a
> try/catch block around those String to number conversions. You're
> probably getting a NumberFormatException thrown when you get your
> error message. That's the exception you want to catch.
>  
> Also, you found a very creative use of the String.compareTo()
> function, but what you probably want to use is String.length()
> instead. For example, 'if (state.getText().compareTo("") != 2)' should
> probably be written as 'if (state.getText().length() != 2)'.  The way
> you have it written (I think) works, but using the length() function
> is more appropriate for what you are doing (and executes faster.)
>  
> Tony
>  
> > Date: Sat, 25 Sep 2010 07:22:05 -0400
> > From: frrobert@xxxxxxxxxxxxx
> > To: frgeek-michiana@xxxxxxxxxxxxx
> > Subject: [frgeek-michiana] Re: Java code help
> > 
> > Chuq,
> > 
> > I do not know Java but code is code in some respects.
> > 
> > For pmtAmount and zipCode I don't see any error logic.
> > 
> > For the other variables you have if statements to catch any errors
> and 
> > throw a message box
> > 
> > For pmtAmount and zipCode you get the text assign it to a sting,
> convert 
> > it to a number and tell it to show the message dialog. So I would
> think 
> > it would always show the dialog. Should you not have if statements
> or 
> > on error statement for pmtAmount and zipCode?
> > 
> > Thanks,
> > 
> > Fr. Robert Bower
> > Batushka's Web Hosting& Design
> > frrobert@xxxxxxxxxxxxx
> > 574.850.7982
> > http://www.batushkas.com
> > http://www.batushkas.net
> > 
> > 
> > On 09/24/2010 11:10 PM, chuq wrote:
> > > Hey all, if anyone knows a thing or two about java and could lend
> a
> > > helping hand I would appreciate it, the code is here
> > > http://pastebin.com/iFuiqu2P
> > > where I am having a problem is around 212-219 I think.
> > > The acctNum must be a length of 10 alphanumeric
> > > and state is obviously supposed to be a 2 letter length
> > > when I run the program it throws the error as if it is a number
> from
> > > line 222.
> > > If anyone can help out I would appreciate it greatly.
> > >
> > > Chuq
> > >
> > > ** This list is PUBLICLY archived. **
> > > PLEASE don't post personal or sensitive information unless you
> wish for it to be in the public domain.
> > >
> > > To visit the main website for Free Geek Michiana go to
> http://www.freegeekmichiana.org
> > >
> > > To post to the list send email to frgeek-michiana@xxxxxxxxxxxxxx
> > > The archive is available at
> //www.freelists.org/archives/frgeek-michiana/
> > >
> > > You may unsubscribe or change your list settings by going to the
> list website at //www.freelists.org/webpage/frgeek-michiana
> > >
> > >
> > > 
> > ** This list is PUBLICLY archived. **
> > PLEASE don't post personal or sensitive information unless you wish
> for it to be in the public domain.
> > 
> > To visit the main website for Free Geek Michiana go to
> http://www.freegeekmichiana.org
> > 
> > To post to the list send email to frgeek-michiana@xxxxxxxxxxxxxx
> > The archive is available at
> //www.freelists.org/archives/frgeek-michiana/
> > 
> > You may unsubscribe or change your list settings by going to the
> list website at //www.freelists.org/webpage/frgeek-michiana
> > 


** This list is PUBLICLY archived. **
PLEASE don't post personal or sensitive information unless you wish for it to 
be in the public domain.

To visit the main website for Free Geek Michiana go to 
http://www.freegeekmichiana.org

To post to the list send email to frgeek-michiana@xxxxxxxxxxxxxx
The archive is available at //www.freelists.org/archives/frgeek-michiana/

You may unsubscribe or change your list settings by going to the list website 
at //www.freelists.org/webpage/frgeek-michiana

Other related posts: