|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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";
|
|
#3
|
|||
|
|||
|
Yeah.. you had a lot of random stuff there that doesn't make any sense. Please ask again.
|
|
#4
|
|||
|
|||
|
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).] |
|
#5
|
|||
|
|||
|
>>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. |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
||||
|
||||
|
<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).] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > A few questions regarding STDIN and print commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|