home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR36 / KEXX.ZIP / TINDENT.KML < prev   
Text File  |  1989-12-20  |  2KB  |  123 lines

  1. *
  2. *  Template completion for C programmers
  3. *
  4.  
  5. :C-T
  6. * Toggle template escape
  7. 'Editv Getf IEscape'
  8. If IEscape = 'ON'
  9.    Then Do
  10.       'Editv Setf IEscape OFF'
  11.       'Emsg Template completion is now enabled'
  12.    End
  13.    Else Do
  14.       'Editv Setf IEscape ON'
  15.       'Emsg Template completion is now disabled'
  16.    End
  17.  
  18. Exit
  19.  
  20. :SPACE
  21. 'Editv Getf Templates'; If Templates = "" Then Templates = 0
  22. 'Editv Getf IEscape'
  23.  
  24. If (Pos(' 'FType.1()' ', ' C H CPP ') = 0) | (\Templates) | IEscape = 'ON' | Command()
  25.    Then Do
  26.       * Don't do anything special
  27.       'Text  '
  28.       Exit
  29.    End
  30.  
  31. If \NoQueue()
  32.    Then
  33.       Exit
  34.  
  35. C = Lower(Curline.3())
  36. One = Word(C, 1)
  37. I = Pos(One, C)
  38. If I > 0
  39.    Then Do
  40.       C = SubStr(C, I)
  41.       L = Length(C)
  42.    End
  43.    Else Do
  44.       'Text  '
  45.       Exit
  46.    End
  47.  
  48. If InsertMode()
  49.    Then
  50.       IMode = "ON"
  51.    Else
  52.       IMode = "OFF"
  53.  
  54. 'Set InsertMode Off'
  55.  
  56. If C = SubStr('els', 1, L)
  57.    Then Do
  58.       'SOS FirstChar'
  59.       'Text else '
  60.       'InsertMode' IMode
  61.       Exit
  62.    End
  63. Else If C \= 'else' & C = SubStr('else if (', 1, L)
  64.    Then Do
  65.       'SOS FirstChar'
  66.       'Text else if ()'
  67.    End
  68. Else If C = SubStr('if (', 1, L)
  69.    Then Do
  70.       'SOS FirstChar'
  71.       'Text if ()'
  72.    End
  73. Else If C = SubStr('while (', 1, L)
  74.    Then Do
  75.       'SOS FirstChar'
  76.       'Text while ()'
  77.    End
  78. Else If C = SubStr('for (', 1, L)
  79.    Then Do
  80.       'SOS FirstChar'
  81.       'Text for ()'
  82.    End
  83. Else If C = SubStr('switch (', 1, L)
  84.    Then Do
  85.       'SOS FirstChar'
  86.       'Text switch ()'
  87.    End
  88. Else If C = SubStr('case', 1, L)
  89.    Then Do
  90.       'SOS FirstChar'
  91.       'Text case :'
  92.    End
  93. Else If C = SubStr('break', 1, L)
  94.    Then Do
  95.       'SOS FirstChar'
  96.       'Text break; '
  97.       'InsertMode' IMode
  98.       Exit
  99.    End
  100. Else If C = SubStr('default', 1, L)
  101.    Then Do
  102.       'SOS FirstChar'
  103.       'Text default: '
  104.       'InsertMode' IMode
  105.       Exit
  106.    End
  107. Else If C = SubStr('retur', 1, L)
  108.    Then Do
  109.       'SOS FirstChar'
  110.       'Text return'
  111.       'InsertMode' IMode
  112.       Exit
  113.    End
  114. Else Do
  115.    'InsertMode' IMode
  116.    'Text  '
  117.    Exit
  118. End
  119.  
  120. 'InsertMode On'
  121. 'SOS CLeft'
  122. Exit
  123.