Results 1 to 7 of 7

Thread: Ctrl + z

  1. #1
    Zelaine is offline Senior Member
    Join Date
    Aug 2013
    Location
    Sweden
    Posts
    161
    Rep Power
    2

    Question Ctrl + z

    You can use CTRL + Z if you don't want to input any more numbers in the loop down below (the third row), right? Well, apparently not in Eclipse. I can do it in BlueJ but for some reason it doesn't work in Eclipse. Do you know what I might have done wrong? (This is not the whole program btw, just a small part of it).

    Java Code:
    Scanner hej = new Scanner(System.in);
    int tal[] = new int[1000], antal = 0;
    while(hej.hasNextInt())
    	tal[antal++] = hej.nextInt();

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: Ctrl + z

    You didn't do anything wrong; it's a very old omission in Eclipse's console: ctrl-Z doesn't do anything.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Zelaine is offline Senior Member
    Join Date
    Aug 2013
    Location
    Sweden
    Posts
    161
    Rep Power
    2

    Default Re: Ctrl + z

    So is there a substitute of some kind for the code above?

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: Ctrl + z

    I just tried it on my Eclipse installation (Indigo) and I must apologize: ctrl-Z works fine now (it's probably ctrl-D on linux/unix installations).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,367
    Rep Power
    6

    Default Re: Ctrl + z

    You can always press the red stop button in the console view to stop a program.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: Ctrl + z

    Quote Originally Posted by gimbal2 View Post
    You can always press the red stop button in the console view to stop a program.
    Very subtle indeed; decapitate and slice the program to pieces when it doesn't want to read anymore ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    Zelaine is offline Senior Member
    Join Date
    Aug 2013
    Location
    Sweden
    Posts
    161
    Rep Power
    2

    Default Re: Ctrl + z

    @ gimbal2 I want the program to continue going after the loop, so ending it with the red button doesn't really solve anything :/

Similar Threads

  1. hasNext, Ctrl-Z not working
    By kahwawashay in forum New To Java
    Replies: 15
    Last Post: 05-12-2012, 10:16 AM
  2. Ctrl+X on JButton
    By tyroceur in forum New To Java
    Replies: 35
    Last Post: 06-16-2010, 05:20 PM
  3. Write ctrl-z characters
    By jithan in forum New To Java
    Replies: 3
    Last Post: 02-18-2009, 04:11 AM
  4. Classpath is broken after Ctrl+S
    By vetalok in forum Eclipse
    Replies: 2
    Last Post: 08-18-2008, 11:35 AM
  5. Run method on Ctrl+Shift+D
    By Echilon in forum AWT / Swing
    Replies: 1
    Last Post: 02-16-2008, 11:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •