[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

650.0. "Single Character input?" by LESLIE::LESLIE (In the grip of a vile cold) Tue Jan 05 1988 19:37

    
    Has anyone come up with a *DCL* method of getting single-character
    input?
    
    IE ask a question, wait for Y or N then react, with no <return> needed.
T.RTitleUserPersonal
Name
DateLines
650.1CASEE::VANDENHEUVELMake my DayWed Jan 06 1988 06:1026
    Andy,
    
    	I have a DCL hack that did that, but it relys on an ugly time-out
    which did not harm my application (there was actual processing (clock!))
    but which might be unacceptable for you. I think you are much better
    of providing a silly program to do this (2 lines BASIC?, or 20 lines
    macro, or 4 lines pure debugger instructions).
    Still, the following code can show you a direction to go...
    
    Have fun,
    		Hein.
    
$ESC[0,8]=27				!Handy
$WRITE SYS$OUTPUT ESC+"[H"+ESC+"[JPlease enter Y/N:"
$TIMER:
$WRITE SYS$OUTPUT ESC+"[H"
$WAIT 0:0:2
$SET TERM/NOESC/NOLINE/NOECHO		!Set up terminal
$WRITE SYS$OUTPUT ESC+"[6n"+ESC+"[6n"	!Ask for cursor (or other) report twice
$READ/PROMPT="" SYS$OUTPUT X		!User character terminated by ESC.
$SET TERM/ESC				!Entire escape sequence = terminator
$READ/PROMPT="" SYS$OUTPUT Y		!Y=Report terminated by second report.
$IF X.EQS."" THEN $GOTO TIMER
$DONE:
$WRITE SYS$OUTPUT "User input was :", X
$SET TERM/NOESC/LINE/ECHO		!Reset terminal
650.2Look in the toolshedTUBORG::HAGERTYVeni,Vedi,$cmkrnli,rebootiThu Jan 07 1988 09:348
    There is a hack in the toolshed to do this.  I had a friend ask
    me this exact question about a year ago.  I told him there was no
    way to do single character input.  He said what about the "mumble"
    command at DCL.  I told him that such a command does not exist (sorry,
    I don't remember its name.)  "funny, it works on my machine".  Set
    command/table strikes again.
    
    							Dave()