• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unclosed string in db.db ?

 
DirtyHarry
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
When I try this piece of code on the file db.db
I got a system exit because the array of string is not
correctly formatted.
it looks like that:
"SA003" "SFO" "LAX" "SpeedyAir "100 "tue" "10:50" "22m " 37
because the string are not close i got a problem ?
any clues ?
here's the code i'm using:
import suncertify.db.*;
import java.io.*;
public class First{
public static void main(String args[]){
try{
Data d = new Data("../db.db");
DataInfo di = d.getRecord(3);
String[] values = di.getValues();

for (int j=0;j<values.length;j++)>
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
}
}
 
Jim Dong
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I believe that your code has little problem.
The following code

for (int j=0;j System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}

should probably be:
for (int j=0; j less than values.length; j++) {
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
Hope this helps.
(Sorry I can't put the real "less than" sign there )

[This message has been edited by Jim Dong (edited July 31, 2001).]
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you surround the sign by spaces, you can use a less than sign, like so: < And otherwise you can always use HTML escapes: &lt; should give <.
[This message has been edited by Peter den Haan (edited August 01, 2001).]
 
DirtyHarry
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code displayed is not the code I wanted to display, The
< sign erased part of my code.
what should be read is :
for (int j=0;j<9;j++){
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
Sorry about the confusion,
I'm anyway really surprised that no one else got this problem...
Does anybody knows if all the code for the certification are the same or does some little differences exists ?

Originally posted by Jim Dong:
Hi,
I believe that your code has little problem.
The following code
[b]
for (int j=0;j System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}

should probably be:
for (int j=0; j less than values.length; j++) {
System.out.println(" values "+j+" = "+values[j]);
}catch(Exception e){}
Hope this helps.
(Sorry I can't put the real "less than" sign there )

[This message has been edited by Jim Dong (edited July 31, 2001).][/B]

 
Rick Fortier
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter -- Wow, I am surprised you didn't say anything about DirtyHarry's name as not being acceptable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic