//
//	Compiler specific support macro
//
//	For: Borland Turbo Pascal version 5
//

//
//	Display name of compiler
//
:NAME:
Message("Borland Turbo Pascal 5")
Return

//
//	Run compiler
//
:COMPILE:
Reg_Set(98,"> vcs.tmp")		// Reroute output to vcs.tmp
Call(103,"MAKE-BAT")		// Create VCS-TMP.BAT file
System(`"|@(96)\vcs-tmp.bat"`,DOS+NOMSG+SIMPLE)
Return

//
//	Find next/previous error
//
:FINDERROR:
if (#96==REVERSE) {			// If performing previous error
    #97 = (2-At_EOF)			// Need to backup by 2 occurrences
}					// or 1 if at end-of-file
else { #97 = 1 }			// Else search for next occurrence

Search("|{|<Error ,): Error ,): Target}",#96+NOERR+COUNT,#97)
					// Search to next/previous error
if (Return_Value!=#97) {		// If no error found...
    if (#96==REVERSE) {			// If "Previous" error failed...
	Begin_Of_File()			// Position at beginning of listing
    } else {				// Else must be "Next" error
	End_Of_File()			// Position at end
    }
    Return
}
Char(Chars_Matched)			// Advance past the found string
if (Chars_Matched==0) {			// Fatal error or Command line warning
    #95 = 0
    Reg_Empty(81)			// Line number=0, No file name
}
if (Chars_Matched==6) {			// Fatal Errors
    #95 = 0
    Reg_Empty(81)			// Line number=0, No file name
    EOL() Reg_Copy(82,-0)		// @82 = entire error message
}
if (Chars_Matched==9) {			// Errors and warnings
    #97 = Cur_Line			// Save current line number
    //
    // Modifications by Ch.Ziemski, 11/10/1997
    //
    // The (german) TPC version 7.0 reports some (useless) infos in the same line 
    // with the error message itself. Every of these infos is ended with a <CR>, so that 
    // it is overwritten on the screen by the next line and finally by the error message.
    // These infos prevent VEDIT from going to the error line in the source code.
    // The following commands jump behind the first control character in front of the 
    // error message (<CR> or <CR><LF>) and delete up to the BoL.
    //
//    BOL()
    S("|C", REVERSE+ADVANCE+NOERR)
    Del_Line(0)
    //
    // end of modification
    //
    Block_Begin(Cur_Pos)
    if (Search("(",ADVANCE+NOERR) && Cur_Line==#97) {
					// If error found on current line...
	Block_End(Cur_Pos)
	#95 = Num_Eval(SUPPRESS)	// #95 = line number
	Reg_Copy_Block(81,Block_Begin,Block_End-1)
					// @81 = source filename
	Line(2)				// Error is 3 lines long
	EOL() Reg_Copy(82,-2)		// @82 = entire error message
	#75 = Cur_Pos
	BOL()
	#75 -= (Cur_Pos+1)		// #75 = column offset of error
    } else {
	#95 = 0
	Reg_Empty(81)			// Line number=0, No file name
	Goto_Pos(Block_Begin)
	EOL() Reg_Copy(82,-0)
    }
}

Line(1) Block_Begin(-1)			// Move past error and clear markers
Return

//
//	   Return @81 = default "*.PAS" edit/project file extension
//
:DEFAULT:
Reg_Set(81,"*.PAS")
Return

//
//	Locate line in file
//
:GOTOLINE:
Goto_Line(#95)				// Goto line # #95
Return
