ÿ@SUBJECT:TSEditor 2.00 Macros (2/3) N
The following pair of macros are meant to allow easy access to any
specific ordinal word on any specific line within the current buffer.
They are for internal use only, and not for binding to a key. They
replace a roughly equivalent but less capable pair of macros in the
default tse.ui user interface configuration file. The first of the
two following macros originated approximately two years ago with
(I believe) David Marcus.
/* --------------------------88------------------------- */
string proc iGetWordAtCursor()
string wordatcursor[127] = emptystring
PushPosition()
PushBlock()
if MarkWord() or (Left() and MarkWord())
wordatcursor = GetMarkedText()
endif
PopBlock()
PopPosition()
return(wordatcursor)
end
constant zero = 0, one = 1
string emptystring[0]
string proc iGetOrdinalWordInLine(integer linenum, integer ordinal)
string ordinalwordinline[127] = emptystring
integer wordnum = zero
PushPosition()
GotoLine(linenum)
if (PosFirstNonWhite() >= one)
GotoPos(PosFirstNonWhite())
repeat
if isWord()
wordnum = wordnum + one
endif
until (wordnum == ordinal) or not WordRight() or not isWord()
if isWord()
ordinalwordinline = iGetWordAtCursor()
endif
endif
PopPosition()
return(ordinalwordinline)
end
/* --------------------------88------------------------- */
--- FidoPCB v1.4 [ff151/a]
---------------
* Origin: SemWare Support BBS * 404-641-8968 * (1:133/314)
|