#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    can anyone help me on this little problem.

    im printing a message on screen which i want to replace after a user input like:
    print ("Enter command: ");
    $Command=<STDIN>;
    Print ("nCommand Accepted");

    i want to do this but when command accepted is put on screen it replaces Enter command rather than goes under it. can this be done and if so how?

    also does anyone know how to change the user input from requireing the user to press enter to complet thier input? i want to be able to use the cursor keys instead of enter. can this be done? if so any pointers?

    thanks for your help on this 1.

    Tigger

  2. #2
  3. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    15
    can you reword your question? what exactly are you trying to do? do you want a new line after it prints "enter command?", if so then just do print "Enter Commandn";
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    16
    Yeah.. you had a lot of random stuff there that doesn't make any sense. Please ask again.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    what im exactly trying to do is this:

    [1] to print a statement on screen. following this i want to print another statement ontop of the first one NOT under it.

    [2] to change $Demand=<STDIN>; so that instead of user input ending when they press enter the user input ends when they press either up or down on the arrow keys.

    i hope this clears up exactly what im trying to do and i really hope you can help.


    [This message has been edited by Tigger (edited October 21, 2000).]
  8. #5
  9. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>following this i want to print another statement ontop of the first one NOT under it

    What is following this? After he clicks the submit button? If not, printing to screen goes downward from top to bottom, you can't do that, I wonder what kind of mind you have.

    >>user input ends when they press either up or down on the arrow keys

    This is just a client side issue.

    Your questions have nothing to do with Perl at all.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    thanks m8.. yes you can print ontop through using the TK graphics ability but im sure their must be an easier way. Their are abilities to do this in Pascal, Java and C++.

    As regarding changing the stdin their MUST be a way as other wise a number of perl applications that i know of wouldn't work.

    by the way. if you have nothing helpful to say then don't say anything at all. Ahd about what kind of mind i have, i have a degree in business information systems and am a final year student on a computer sci degree. My questions have everything to do with Perl u gimp.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    16
    freebsd, if he's using a $var=<STDIN>; input, it's obvious that he's not doing a web-based thing here. It's an interactive thing that being run from a command prompt or something (since http cannot be a persistent connection).

    However, I still don't understand the question, oh well.
  14. #8
  15. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Southern California
    Posts
    73
    Rep Power
    15
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
    [1] to print a statement on screen. following this i want to print another statement ontop of the first one NOT under it.
    [/quote]

    You can clear the sceen with this command:
    print "e[;He[2J";

    Then print your new text.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
    [2] to change $Demand=<STDIN>; so that instead of user input ending when they press enter the user input ends when they press either up or down on the arrow keys.
    [/quote]

    You can change the input record separator from a newline "n" to an arrow key:

    $LEFT_ARROW = 0xAC;
    $UP_ARROW = 0xAD;
    $RIGHT_ARROW = 0xAE;
    $DOWN_ARROW = 0xAF;

    $/ = $UP_ARROW;

    But your shell will not like the arrow key.

    Why do you not want the newline? If it's because of multi-line input, you can change the input record separator ($/) to the escape key or something.




    [This message has been edited by vpopper (edited October 24, 2000).]

IMN logo majestic logo threadwatch logo seochat tools logo