Networking problem
From: JONESEY (nospam)
Date: 11/30/03
- Next message: MontereySoft: "Re: Bar codes / UPC Question/Help"
- Previous message: f: "Derived data and process, a pattern?"
- Next in thread: Sudsy: "Re: Networking problem"
- Reply: Sudsy: "Re: Networking problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 Nov 2003 17:10:33 +0000
Im trying to get a text file from a server and load it into a 2
dimensional array. So i came up with the follwoing method. The file is
a table using "|" to indicate the end of a cell and "¬" to indicate
the end of a row. I use if statements to find these but the if
statements done seem to to execute!! Any ideas?
J
void getFile(String url) throws IOException {
int x = 0;
int y = 0;
StreamConnection c = null;
InputStream s = null;
StringBuffer b = new StringBuffer();
TextBox t = null;
String temp;
try {
c = (StreamConnection)Connector.open(url);
s = c.openInputStream();
int ch;
while((ch = s.read()) != -1) {
temp = String.valueOf((char)ch);
if (temp == "|"){
fileArray[x][y] = b.toString();
x++;
b = null;
}
else if (temp == "¬"){
fileArray[x][y] = b.toString();
x = 0;
y++;
b = null;
}
else{
b.append((char) ch);
t = new TextBox("Fetch Page", b.toString(), 1024,
0);
}
}
- Next message: MontereySoft: "Re: Bar codes / UPC Question/Help"
- Previous message: f: "Derived data and process, a pattern?"
- Next in thread: Sudsy: "Re: Networking problem"
- Reply: Sudsy: "Re: Networking problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|