Results 1 to 2 of 2
Thread: [SOLVED] Line number: ?
- 04-03-2008, 10:29 PM #1
Member
- Join Date
- Mar 2008
- Posts
- 24
- Rep Power
- 0
[SOLVED] Line number: ?
Hi, just having a problem at the moment with my code. its only part of the code from the class
What im trying to do is, when i type in the command goto, it will print the line number in which i chose. example when i type goto, then press 3, it will print out line numbeer 3. but the problem im having is, when i type in goto, 0 which is the line number, it gives me an error.PHP Code:public void execute() { buffer = new Buffer(); System.out.print("Line number: "); int pos = Integer.parseInt(getInput()); buffer = editor.getCurrentBuffer(); System.out.println(pos +": " +buffer.getLines().get(pos-1)); buffer.setPos(pos-1); editor.setCurrentBuffer(buffer); }
how could i fix this so that when i type goto, 0 line, it print out the following
Line number: ?
Thanks
- 04-04-2008, 05:46 AM #2
Member
- Join Date
- Mar 2008
- Posts
- 24
- Rep Power
- 0
Similar Threads
-
[SOLVED] Delete Current line from file
By Azndaddy in forum New To JavaReplies: 2Last Post: 04-06-2012, 08:00 AM -
[SOLVED] Last line in JTextArea wont display
By Chris.Brown.SPE in forum Advanced JavaReplies: 5Last Post: 04-11-2008, 01:52 PM -
line number
By kazitula in forum New To JavaReplies: 3Last Post: 11-21-2007, 10:27 PM -
Reading in data from file line by line
By bluekswing in forum New To JavaReplies: 1Last Post: 10-02-2007, 12:19 AM -
how to know the number of the line
By simon in forum New To JavaReplies: 3Last Post: 08-01-2007, 04:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks