TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: JOHN W REED
date: 1995-04-02 22:19:00
subject: TSEditor 2.00 Macro Fix

 [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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.