/*rx * GotoFile.ced ... ARexx program to take care of CED short comings * related to file/buffer management via ARexx. * * First built for use with Compile.ced, but it turns out to be useful * with plain scmsg as well, so when it was discovered that it could * not be of use with Compile.ced it was kept anyways. * * Copyright © 1992 Loren J. Rittle * Use as you will, just document your changes and keep my copyright and * header comment notice intact. SAS and ASDG have explicit permission to * include this work in their respective compiler/editor packages. All * other commercial use is prohibited. This ARexx program must be * distributed in source form. This work is provided in the hopes that * it will be useful, but no warranty is implied or given. * * Loren J. Rittle (rittle@comm.mot.com) * Fri Jul 10 00:25:20 1992 * * Notes: * * Your env:sc/SCMSG file should contain lines that look something * like the following to work with CED: * * PORTNAME rexx_ced * EDITCOMMAND ed "%f" * GOTOFILE send dos/arexx command... "rexx:ced/GotoFile.ced %f" * GOTOLINE jumpto %l 1 * * VBrowse users should use the following syntax: * vbrowse editor "rx rexx:ced/gotofile.ced line %d %s" * * Your env:sc/SCOPTIONS file should contain the following line: * * ERRORREXX */ /* * Changed May 29. 1996 by Jens T. Berger Thielemann, * to support optional line number (and thus vbrowse). */ /* NO GENERAL USER MODIFIABLE PARTS BELOW THIS COMMENT. */ If ~Show('ports', 'rexx_ced') Then Do Address Command "CEd" Address Command 'WaitForPort rexx_ced' If ~Show('ports', 'rexx_ced') Then Do Exit 5 End End Address 'rexx_ced' Options Results Parse Arg IsLine Line File If Upper(IsLine) ~= "-L" Then Do Line = -1 File = IsLine End /* * Expand the filename path */ If Index(File, ":") == 0 Then Do TmpFile = "T:GotoFileTmp" Address Command "List >" TmpFile "LFORMAT %f%s" File If Open('Full', TmpFile, 'R') Then Do File = ReadLn('Full') Close('Full') Address Command "Delete >nil:" TmpFile End End 'Jump to file' File If ~Result Then Do Status 16; Size = Result Status 18; Changes = result If (Size ~= 0) | (Changes ~= 0) Then 'Open New' 'Open...' File End If Line >= 0 Then 'Jump to line' Line