Difference between revisions of "Raw I/O"

From ScarletDME
Jump to navigation Jump to search
(New page: ==Raw terminal I/O in QM== If you want to read from input without any character translation, it's necessary to disable some of the helpful processing that QM does. The input stream is c...)
 
Line 10: Line 10:
 
   execute "TERM 32767,32767 NULL"
 
   execute "TERM 32767,32767 NULL"
 
   echo off                          ;* Disables iput echoing
 
   echo off                          ;* Disables iput echoing
   prompt ''                        ;* Disables input prompt character
+
   prompt '''                        ;* Disables input prompt character
 
   junk=@(0, 0)                      ;* Disables output paging
 
   junk=@(0, 0)                      ;* Disables output paging
 
   junk = junk                      ;* Supress compiler warning from above line
 
   junk = junk                      ;* Supress compiler warning from above line

Revision as of 10:02, 5 April 2009

Raw terminal I/O in QM

If you want to read from input without any character translation, it's necessary to disable some of the helpful processing that QM does. The input stream is converted from lower case to upper case (and vice versa), and Ctrl-C is processed as a break character. The output is formatted so as to require user to press <return> after each screenful of characters.

The following bit of code completely disables ALL formatting:-


  execute "TERM 32767,32767 NULL"
  echo off                          ;* Disables iput echoing
  prompt                          ;* Disables input prompt character
  junk=@(0, 0)                      ;* Disables output paging
  junk = junk                       ;* Supress compiler warning from above line
  term_settings = ttyget()          ;* get parameters
  term_settings<1> = 0              ;* Ctrl-C treated as the break key?  (PTERM BREAK mode)
  term_settings<2> = 0              ;* Case inversion on?  (PTERM CASE mode)
  ttyset term_settings              ;* set parameters


Ashley Chapman 2009-04-05