• Post Reply Bookmark Topic Watch Topic
  • New Topic

Code for previous question  RSS feed

 
harrell collins
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mport java.io.*;
import java.util.*;

public class IDT_LOTSTREAM{

StreamTokenizer pages = (new FileReader("/nadm4/tmp/rpt/IDT_LOTA_02242006.less.001"));
int stmt=0;
int pgno=0;
int[]avpag;
int avpag= new int[25];
int curpag=0;

while(pages.nextToken() != null){

if(pages.ttype ==pages.TT_WORD && pages.sval.compareTo("1PAGENM1Page")==0){
count++;
pgno=pages.nextToken();
}
else if(pages.ttype ==pages.TT_WORD && pages.sval.compareTo("1PAGENM2Page")==0){
count++;

}
else if(pages.ttype ==pages.TT_WORD && pages.sval.compareTo("1PAGENM3Page")==0){
count++;

}
else if(pages.ttype ==pages.TT_WORD && pages.sval.compareTo("1PAGENM4Page")==0){
count++;

}
else if(pages.ttype ==pages.TT_WORD && pages.sval.compareTo("1BLANPG")==0){
count++;

}
else if(pages.ttype ==pages.TT_WORD && pages.sval.compareTo("DETAIL4Total")==0){
if((count /2)==0){
for (x=0; x<25; x++){
if(avpag[x] != 0){
avpag[curpag]++;
System.out.println("There are" + avpag[curpage] + avpag[curpag]+ "page statements");

}
}
}

}

}
}
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ummm... what?

are you posting code in this thread for a question you asked somewhere else? why didn't you just post it in that one?

also, it would help folks greatly if you used the code tags... after you paste your code into the text box, highlight it and click that "code" button down below. that will preserve your indentation, making it much more readable.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'previous question' is moving with different speed, I fear
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now if someone can provide the code for the next question, that would be cool.
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jim Yingst:
Now if someone can provide the code for the next question, that would be cool.


I don't know if its because of a lack of sleep, but that was truly laugh out loud funny.
[ March 10, 2006: Message edited by: Garrett Rowe ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!