home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR36
/
KEXX.ZIP
/
TINDENT.KML
< prev
Wrap
Text File
|
1989-12-20
|
2KB
|
123 lines
*
* Template completion for C programmers
*
:C-T
* Toggle template escape
'Editv Getf IEscape'
If IEscape = 'ON'
Then Do
'Editv Setf IEscape OFF'
'Emsg Template completion is now enabled'
End
Else Do
'Editv Setf IEscape ON'
'Emsg Template completion is now disabled'
End
Exit
:SPACE
'Editv Getf Templates'; If Templates = "" Then Templates = 0
'Editv Getf IEscape'
If (Pos(' 'FType.1()' ', ' C H CPP ') = 0) | (\Templates) | IEscape = 'ON' | Command()
Then Do
* Don't do anything special
'Text '
Exit
End
If \NoQueue()
Then
Exit
C = Lower(Curline.3())
One = Word(C, 1)
I = Pos(One, C)
If I > 0
Then Do
C = SubStr(C, I)
L = Length(C)
End
Else Do
'Text '
Exit
End
If InsertMode()
Then
IMode = "ON"
Else
IMode = "OFF"
'Set InsertMode Off'
If C = SubStr('els', 1, L)
Then Do
'SOS FirstChar'
'Text else '
'InsertMode' IMode
Exit
End
Else If C \= 'else' & C = SubStr('else if (', 1, L)
Then Do
'SOS FirstChar'
'Text else if ()'
End
Else If C = SubStr('if (', 1, L)
Then Do
'SOS FirstChar'
'Text if ()'
End
Else If C = SubStr('while (', 1, L)
Then Do
'SOS FirstChar'
'Text while ()'
End
Else If C = SubStr('for (', 1, L)
Then Do
'SOS FirstChar'
'Text for ()'
End
Else If C = SubStr('switch (', 1, L)
Then Do
'SOS FirstChar'
'Text switch ()'
End
Else If C = SubStr('case', 1, L)
Then Do
'SOS FirstChar'
'Text case :'
End
Else If C = SubStr('break', 1, L)
Then Do
'SOS FirstChar'
'Text break; '
'InsertMode' IMode
Exit
End
Else If C = SubStr('default', 1, L)
Then Do
'SOS FirstChar'
'Text default: '
'InsertMode' IMode
Exit
End
Else If C = SubStr('retur', 1, L)
Then Do
'SOS FirstChar'
'Text return'
'InsertMode' IMode
Exit
End
Else Do
'InsertMode' IMode
'Text '
Exit
End
'InsertMode On'
'SOS CLeft'
Exit