destroyApp(true);
notifyDestroyed();
}
if(c==cmdOk){
data=(textfield.getString()).getBytes();
try{
recordID=rs.addRecord(data,0,data.length);
System.out.println("recordID "+recordID+" is added!Total num is "+rs.getNumRecords());
}catch(RecordStoreException e){
System.out.println("Program error!exit");
}
textfield.setString("");
}
if(c==cmdQuery){
try{
int lastID=rs.getNextRecordID();
for(int i=1;i<lastID;i++){
try{
byte[] data1=rs.getRecord(i);
if(data1==null){
System.out.println("null");
rs.deleteRecord(i);
}else{
System.out.println(new String(data1));
}
}catch(InvalidRecordIDException e){
continue;}
}
}catch(RecordStoreException e){}
rf=new RF((textfield.getString()).getBytes());
try{
RecordEnumeration enum=rs.enumerateRecords(rf,null,false);
System.out.println("查询结果如下:");