home *** CD-ROM | disk | FTP | other *** search
- global gEncyFTBreakList, gEncyFTBreakString, gNopeSND
-
- on hPrepBreakList
- set gEncyFTBreakList to value(field "FTencyBreakPoints")
- if not objectp(gEncyFTBreakList) then
- beep()
- put "!! Field FTencyBreakPoints is not a legal list."
- exit
- end if
- sort(gEncyFTBreakList)
- set gEncyFTBreakString to string(gEncyFTBreakList)
- end
-
- on hGetFTpointer pWord
- if gEncyFTBreakString contains pWord then
- set L to hLocate(pWord)
- else
- set L to findPosNear(gEncyFTBreakList, pWord)
- end if
- if L = 0 then
- hReportStatus("Sorry, can't search for that.")
- hearit(gNopeSND)
- abort()
- end if
- return getAt(gEncyFTBreakList, L)
- end
-
- on hFTLimitsTest
- set Llimits to value(field "FTENCY word limits test only")
- if not objectp(Llimits) then
- beep()
- put "!! Field <FTENCY word limits test only> is not a legal list."
- exit
- end if
- sort(Llimits)
- set lk to count(Llimits)
- hPrepBreakList()
- set t to the ticks
- put "Starting. Hit <shift> to stop."
- set i to 1
- repeat while not (the shiftDown)
- set Lw to getAt(Llimits, i)
- set Ln to hGetFTpointer(Lw)
- if Ln > 0 then
- put Lw && ">>" && getAt(gEncyFTBreakList, Ln) && "::" & Ln
- else
- put Lw && "returns" && Ln
- end if
- if i = lk then
- exit repeat
- end if
- set i to i + 1
- end repeat
- set t to the ticks - t
- put "That took" && t && "ticks."
- put "Finished."
- end
-
- on hLocate pWhat
- set vListStart to 1
- set vListEnd to count(gEncyFTBreakList)
- set vFound to 0
- repeat while vFound = 0
- if vListEnd <= (vListStart + 1) then
- set vFound to 1
- end if
- set vCheckPoint to vListStart + ((vListEnd - vListStart) / 2)
- set Ltest to pWhat > getAt(gEncyFTBreakList, vCheckPoint)
- if Ltest then
- set vListStart to vCheckPoint
- next repeat
- end if
- set vListEnd to vCheckPoint
- end repeat
- return vListEnd
- end
-
- on hLocateExact pWhatWord
- set vListStart to 1
- set vListEnd to count(gEncyFTBreakList)
- set vFound to 0
- repeat while vFound = 0
- if vListEnd <= (vListStart + 1) then
- set vFound to 1
- end if
- set vCheckPoint to vListStart + ((vListEnd - vListStart) / 2)
- set Ltest to pWhatWord > getAt(gEncyFTBreakList, vCheckPoint)
- if Ltest then
- set vListStart to vCheckPoint
- next repeat
- end if
- set vListEnd to vCheckPoint
- end repeat
- return vListEnd
- end
-