    ! EDDEFDEV - EDWIN DEFault DEVice routine

    from Imp include Lognames
    external string (255) fn spec TERMINAL MODEL alias "IMP_TERMINAL_MODEL"

    external integer fn DEFAULT DEVICE alias "EDWIN_DEFAULT_DEV"
       const string (255) DEFAULT NAME = "EDWIN_DEFAULT_DEVICE"
       string (127) TERM, Terminal Name

       on 3,4,9 start
          result = 0
       finish

       TERM = TRANSLATE (DEFAULT NAME)
       result = STOI (TERM) if TERM#DEFAULT NAME
       Terminal Name = Translate ("TT")
       result = 4014 if Sub String (Terminal Name,1,3) = "_TK"
       result = 'W'  if Sub String (Terminal Name,1,3) = "_WT"
       TERM = TERMINAL MODEL
       result = 200 if TERM = "VISUAL200"
       result = 131 if TERM = "VT100"
       result = 0
    end

    end of file