Article View: borland.public.jbuilder.java.language
Article #19475Integer Decoding
From: David Gordon
Date: Tue, 27 Jan 1998 00:00
Date: Tue, 27 Jan 1998 00:00
29 lines
1499 bytes
1499 bytes
John,
I tried your suggestions and it worked perfectly. Unfortunately, there is
another "bug" in my code that I need some help with. Shown below is the
code fragement:
ZipStringLow = new String(ZipCodeRangeLow);
Low = Low.decode(ZipStringLow);
ZipCodeLow = Low.intValue() * 100;
ZipCodeFile.read();
ZipCodeFile.read(ZipCodeRangeHigh);
ZipStringHigh = new String(ZipCodeRangeHigh);
High = High.decode(ZipStringHigh);
ZipCodeHigh = (High.intValue() * 100)+99;
I am reading 3 byte ASCII characters into a string. I am then converting
the string into a five digit integer. This code works fine until it
encounters a string of "060" and "069". When it gets one of these strings I
get the dreaded stack error. Specifically,
java.lang.NumberFormatException: 69
java.lang.Integer.parseInt
java.lang.Integer.valueOf
java.lang.decode.
Any help would be appreciated. Thank you.
David
Technical Details
Message-ID:
<6aluvj$sih10@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6ajane$rk210@forums.borland.com> <6alcfi$sd812@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,405d87fec8049c8d X-Google-Attributes: gidf74b3,public From: "David Gordon" <dgordon@microdsi.net> Subject: Integer Decoding Date: 1998/01/27 Message-ID: <6aluvj$sih10@forums.borland.com> X-Deja-AN: 319828746 References: <6ajane$rk210@forums.borland.com> <6alcfi$sd812@forums.borland.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: None Newsgroups: borland.public.jbuilder.java.language