|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#9
|
|||
|
|||
|
Re: Open text file
this is how we have been able to open and read a text file which is terminated by a semi colon:
Code:
private final String PATH = "file:///Sparx/mytxt.txt";
private final char ESC_CHAR = ';';
try
{
FileConnection read = (FileConnection) Connector.open(PATH, Connector.READ);
fileRead = read.openDataInputStream();
String theString = "";
while(true)
{
byte ch = fileRead.readByte();
if(ch == ESC_CHAR)
{
break;
}
theString += (char) ch;
}
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|