home *** CD-ROM | disk | FTP | other *** search
/ CICA 1994 September / CICA_Shareware_for_Windows_Walnut_Creek_September_1994.iso / win3 / desktop / sh93v100.lzh / CI < prev    next >
Text File  |  1993-09-04  |  953b  |  57 lines

  1.  
  2. FUNCTION interpret(text) {
  3.     status (text)
  4.  
  5.     k = index(text, " ")
  6.     key = (k != 0)? substr(text, 1, k - 1): text;
  7.     cmd = (k != 0)? substr(text, k+1): "";
  8.     if (key == "!")
  9.         exec(cmd, 1) | stdout
  10.     else if (key == "dos") {
  11.         dos(cmd " >output");
  12.         f2c("output");
  13.         }
  14.     else if (text != "")
  15.         eval(text) | stdout
  16.  
  17.     printf ("\n> ") | stdout
  18.     return (0);
  19.     }
  20.  
  21.  
  22. /| input input/ {
  23.     interpret(DDEinput);
  24.     }
  25.  
  26. /| input click/ {
  27.     if (substr(DDEinput, 1, 1) == ">") {
  28.         DDEinput = substr(DDEinput, 3)
  29.         printf ("%s\n", DDEinput) | stdout
  30.         }
  31.  
  32.     interpret(DDEinput)
  33.     }
  34.  
  35.  
  36. BEGIN {
  37.     DDEservice = "ci " PROGwindow
  38.     ctrl(2, DDEservice, 1)
  39.  
  40.     if (getmod("tty") == 0) {
  41.         inform(DDEservice,
  42.                "Starten Sie zunächst das Terminal Programm TTY.");
  43.         exit();
  44.         }
  45.  
  46.     tty = "tty|stdio " PROGwindow
  47.     DDEservice "|input" | tty "!open"
  48.  
  49.     stdout = tty "!print"
  50.     interpret("\"system ready\"")
  51.     }
  52.  
  53.  
  54. END {
  55. #    "" | tty "!close"
  56.     }
  57.