home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
164.lha
/
ARexx
/
TXed_ARexx
/
ref.txed
< prev
next >
Wrap
Text File
|
1988-04-28
|
1KB
|
47 lines
/* REF MACRO ala DME*/
/* James Gary */
/* 7-15-88 */
arg lookup
OPTIONS RESULTS
call addlib('rexxsupport.library',0,-30,0) /* For showlist() call */
if (lookup = '') then do
'ST L' /*Get current line from txed */
line = result
'ST R' /*Get cursor position info */
pos = result
col = word(pos,4) /* Current column is 4th word of cursor position result */
/* Find the word the cursor is on. Unlike DME, we do not have to be at
the start of the word */
word = 1
index = wordindex(line, word)
do while ((index <= col) & (word < words(line)))
word = word + 1
index = wordindex(line,word)
end
if (index > col) then word = word -1
lookup = word(line,word) /* lookup is the word the user wants to ref */
/* Send lookup to the macro lookitup. Refport is used only for
synchronization. We will wait untill lookitup sends us a
message through refport, then send lookup through lookport. */
end
call openport('refport')
/* would like to use moretxed, but need rexx macro with new edit window
port as host. Seperate invocation of txed seems easiest way to do this. */
address command 'e STARTUP lookitup'
call waitpkt('refport')
packet = getpkt('refport')
call reply(packet,0) /* We don't care about message, just synchronized */
call closeport('refport')
address 'lookport' lookup
/*
Window <- test reference word
*/