[Date: 2 April 1995]
[Time: 6:58pm]
I made a slight mistake in the second of the two macro sets. The
global variables should appear *before* the first macro in that set,
*not* after it. Also, while testing that set a little more, I came
across an obscure bug that manifests itself only when the line being
tested for an ordinal word is exactly 2032 characters long and has a
nonwhite character at the end. While fixing this bug, I fixed another
possible problem with the logic.
This is the fixed version:
/* --------------------------88------------------------- */
constant maxeditorcolumn = 2032
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 (CurrCol() == maxeditorcolumn)
or not WordRight()
or not isWord()
if isWord() and (wordnum == ordinal)
ordinalwordinline = iGetWordAtCursor()
endif
endif
PopPosition()
return(ordinalwordinline)
end
/* --------------------------88------------------------- */
--- FidoPCB v1.4 [ff151/a]
---------------
* Origin: SemWare Support BBS * 404-641-8968 * (1:133/314)
|