home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR36
/
KEXX.ZIP
/
CC.KEX
< prev
next >
Wrap
Text File
|
1992-06-15
|
3KB
|
95 lines
************************************************
* CC.KEX
*
* Function: Compile programs and locate the lines that generated
* compiler errors.
* To run: See CC.DOC for complete documentation.
* Requires: KEDIT 5.0 and RUNCMD.KEX
* Version: 2.0 (June, 1992)
*
* User set EDITV variables:
* CC_Extension commands for specific extensions (no defaults)
* CC_NextKey default: "Alt-N"
* CC_PrevKey default: "Alt-P"
* CC_CurrKey default: "Alt-T"
*
************************************************
* If we are run as a profile, run the user's profile first.
If Initial() Then Do
'Macro' DefProfile.1()
Arg = '-'
End
Else
Arg = Arg(1)
If Arg \= '-' Then Do
original_fileid = fileid.1()
* Write files to disk if necessary
Do I = 1 To NBFile.1()
'Kedit'
If \Alt() Then Iterate
FileName = FName.1()
FileExt = FExt.1()
* Skip prompting for obviously unimportant files
If Dir() Then Iterate
If FileName = "MACROS" & FileExt = "KML" Then Iterate
If FileExt = "TMP" Then Iterate
If Fileid.1() \= original_fileid then do
'Dialog /Save changes to' Fileid.1()'/ YESNOCANCEL'
If Dialog.2 = "CANCEL" Then Exit
If Dialog.2 = "NO" Then iterate
End
'NoMsg Save'
If RC \= 0 Then Do
M = 'Unable to save changes to' Fileid.1()''D2C(10)D2C(10)''LastMsg.1()
'Alert' Delimit(M) 'Title /Fatal Error/'
Exit 1
End
End
End
'Editv Get CC_NextKey CC_PrevKey CC_CurrKey'
If CC_NextKey = '' Then CC_NextKey = 'Alt-N'
If CC_PrevKey = '' Then CC_PrevKey = 'Alt-P'
If CC_CurrKey = '' Then CC_CurrKey = 'Alt-T'
* Get command, either from arg(1), file, or from editv variable
If Arg \= '' Then Do
CC_Cmd = Arg
'Editv SetL CC_'FType.1() CC_Cmd
End
Else Do
SaveLine = Line.1()
'NoMsg Locate :0 Locate Blank | / cc: "/'
If RC = 0 & CurLine.3() \= '' Then Do
* Get value from file
CC_Cmd = SubStr(CurLine.3(), Target.4() + 1)
P = Pos('"', CC_Cmd)
If P = 0 Then Do
'Alert $No closing quote for CC: entry in file$ Title $CC$'
Exit
End
CC_Cmd = SubStr(CC_Cmd, 1, P - 1)
End
Else Do
* Get value from Editv variable
'NoMsg Editv List CC_'ftype.1()
If Word(LastMsg.1(), 2) = '' Then Do
m = 'No command found for extension ".'ftype.1()'". To use CC, issue'
m = m || d2c(10) || '"CC your-compile-command" on the command line.'
'Alert' delimit(m) 'Title $CC$'
Exit
End
CC_Cmd = SubStr(LastMsg.1(), Length(Word(LastMsg.1(), 1)) + 1)
End
'Locate :'SaveLine
End
'Macro RunCmd /%m/ cc CC.TMP message' CC_NextKey CC_PrevKey CC_CurrKey 'DOSNOWAIT' CC_Cmd
Exit