home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: ErrorStep.bed 1.0 (14.01.96)
- **
- ** Move the cursor to the lines of errors occurred during compilation
- ** with SAS C.
- */
-
- ARG direction
-
- port = ADDRESS()
- Address 'SC_SCMSG'
-
- INTERPRET direction
-
- OPTIONS RESULTS
-
- 'File'
- main.file = RESULT
-
- IF file = "" THEN DO
- ADDRESS
- SetStatusBar "No SAS/C Errors"
- EXIT 0
- END
-
- 'AltFile'
- alt.file = RESULT
-
- 'Number'
- err.num = RESULT
-
- 'Text'
- err.text = RESULT
-
- Call MainFile port
-
- IF alt.file ~= "" THEN CALL AltFile port
-
- EXIT 0
-
-
- /*-------------------------------------------------------------------*/
-
- MainFile:
- PARSE ARG port
-
- Address 'SC_SCMSG'
- 'Line'
- main.line = RESULT
-
- CALL FindFileName main.file
- main.name = RESULT
-
- CALL FindFilePort main.name,main.file,port
- main.port = RESULT
-
- IF main.port = "" THEN RETURN
-
- ADDRESS VALUE main.port
-
- Move main.line 0
- ActivateWindow
- Window2Front
- SetStatusBar err.num||': '||err.text
-
- RETURN
-
- /*-------------------------------------------------------------------*/
-
- AltFile:
- PARSE ARG port
-
- Address 'SC_SCMSG'
- 'AltLine'
- alt.line = RESULT
-
- CALL FindFileName alt.file
- alt.name = RESULT
-
- CALL FindFilePort alt.name,alt.file,port
- alt.port = RESULT
-
- IF alt.port = "" THEN RETURN
-
- ADDRESS VALUE alt.port
- Move alt.line 0
- ActivateWindow
- Window2Front
- SetStatusBar err.num||': '||err.text
-
- RETURN
-
-
- /*-------------------------------------------------------------------*/
-
- /*
- ** FindFileName -- Extracts the filename part of a path specification.
- */
-
- FindFileName: PROCEDURE
- parse arg path
-
- dirend = LastPos('/', path)
- if dirend = 0
- then dirend = Pos(':', path)
- if dirend ~= 0
- then name = SubStr(path, dirend+1)
- else name = path
-
- return name
-
- /*-------------------------------------------------------------------*/
-
- /*
- ** FindFilePort -- Finds the TurboText port corresponding to a file, or
- ** tries to open the file if it is not in memory.
- */
-
- FindFilePort: PROCEDURE
- parse arg file,path,port
-
- Address BED GetPort file
-
- if RESULT = "RESULT"
- then do
- Address VALUE port
- promptstr = '"Load ' || file || '?"'
- RequestBool '"TTX <=> SAS/C"' promptstr
- if RESULT = "YES"
- then do
- OpenDoc NAME path
- Return RESULT
- end
- else Return ""
- end
- else Return RESULT
-