home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 10
/
aminetcdnumber101996.iso
/
Aminet
/
util
/
rexx
/
AGGrep.lha
/
TTXEditAtLine.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1995-09-21
|
1KB
|
48 lines
/* TTX EDIT AT LINE
**
** This program takes as it's argument the filename and a line number in the form
** file|linenum. It then opens turbotext with that file and at that line number
**
** Brian Gragg 9/20/95
**********************************************************************************/
version_string = "$VER: TTXEditAtLine 9/20/95 V1.0 © 1995 Brian Gragg"
PARSE ARG filename "|" linenum
IF ~Exists(filename) THEN DO
SAY "Couldn't Find file: "filename
EXIT(10)
END
file = Upper(SubStr(filename,1 + Max(LastPos("/",filename), LastPos(":",filename))))
OPTIONS RESULTS
IF ~Show('P',"TURBOTEXT") THEN DO
ADDRESS COMMAND "turbotext:ttx BACKGROUND NOWINDOW"
ADDRESS COMMAND "sys:rexxc/waitforport TURBOTEXT"
END
ADDRESS "TURBOTEXT"
'GetDocuments'
list = RESULT
UList= Upper(list)
posn = Find(UList, '"'||file||'"')
IF posn=0 THEN DO
'OpenDoc PUBSCREEN "TURBOTEXT"' filename
port = RESULT
ADDRESS COMMAND 'sys:rexxc/waitforport 'port
END
ELSE
port = Word(list, 1 + posn)
ADDRESS Value port
'Screen2Front'
'Window2Front'
'ActivateWindow'
'CenterView'
'Move' linenum