View Single Post
  #1 (permalink)  
Old 04-04-2008, 12:29 AM
Azndaddy Azndaddy is offline
Member
 
Join Date: Mar 2008
Posts: 24
Azndaddy is on a distinguished road
[SOLVED] Line number: ?
Hi, just having a problem at the moment with my code. its only part of the code from the class

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);
    } 
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.

how could i fix this so that when i type goto, 0 line, it print out the following
Line number: ?

Thanks
Reply With Quote
Sponsored Links