Hi everyone, merry christmas! im having a bit of a problem with a string tokenizer! i wondered if someone could show me how its done please.

im trying to set up my own reserved word - END, which will end the program and print a message.

this is what i have so far, i want it to produce a message when it encounters an END and say how many lines it has processed. (i have a text file which is being opened and it looks for the END in there)

What I meant to say was that whenever there is an END in the program itself it will terminate and produce a message. I didnt mean to say that it looks for an END in the txt file. Sorry for the confusion!

12-23-2004, 11:51 PM

Eversys

Not to sure what exactly you want to do.. but
if(line=="END")
that can't happen... the == operator doesn't work on literal strings. Use .equals(); or .equalsIgnoreCase();

12-24-2004, 09:06 AM

nm08

creating a new reserved word

thanks for your help!

im trying to compose a program that will terminate whenever it encounters an "END" instruction.

This means i am trying to set up my own reserved word for "END" so it understands what to do.