home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
text
/
sasc_golded
/
scmsg_loadfile.ged
< prev
next >
Wrap
Text File
|
1995-02-27
|
3KB
|
85 lines
/* scmsg_loadfile.ged V1.0
written in 1994 by Roland Schwingel
Lilienthalstraße 9
92421 Schwandorf
Germany
Description:
AREXX Script for SAS/C SCMSG util.
Positionates Cursor on line with an Error in any file.
Checks whether the file in which the error occured is
loaded in Golded or not. If not the file is loaded
and the cursor is positioned in the line with the error.
*/
OPTIONS RESULTS /* enable return codes */
if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
address 'GOLDED.1'
'LOCK CURRENT' /* lock GUI, gain access */
OPTIONS FAILAT 6 /* ignore warnings */
SIGNAL ON SYNTAX /* ensure clean exit */
/* ------------------------ INSERT YOUR CODE HERE: ------------------- */
arg arguments /* Filename und Zeilennummer holen */
FILENAME=WORD(arguments,1) /* Filename */
ERRLINE=WORD(arguments,2) /* Zeilennummer */
LOOP=0
FOUND=0
SEARCHNAME=upper(FILENAME); /* In Grossbuchstaben */
'WINDOW ORDINAL 0 QUIET' /* Von vorne suchen */
'QUERY DOC VAR FIRSTWINNAME' /* Dateiname holen */
WINNAME=upper(FIRSTWINNAME) /* In Grossbuchstaben */
FIRSTWINNAME=WINNAME
/* Offene Fenster durchsuchen, ob gewünschtes mit dabei */
/* Achtung: Eingefrorene Fenster werden nicht erkannt */
do while (loop ~= 1)
if (WINNAME = SEARCHNAME)
then do
LOOP=1 /* Gefunden => abbrechen */
FOUND=1
end
else do /* Nächstes suchen */
'WINDOW NEXT QUIET'
'QUERY DOC VAR WINNAME'
WINNAME=upper(WINNAME) /* in Grossbuchstaben */
if (WINNAME = FIRSTWINNAME)
then do
LOOP=1 /* nicht gefunden => abbrechen */
FOUND=0
end
end
end
if (found = 1)
then do /* gefunden */
'WINDOW USE 'FILENAME'' /* Fenster aktivieren */
end
else do
'OPEN NAME 'FILENAME' SMART QUIET' /* nicht gefunden => laden */
end
'GOTO LINE 'ERRLINE' UNFOLD TRUE' /* Cursor auf Zeile setzen */
/* ---------------------------- END OF YOUR CODE --------------------- */
'UNLOCK' /* VERY important: unlock GUI */
EXIT
SYNTAX:
SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
'UNLOCK'
EXIT