home *** CD-ROM | disk | FTP | other *** search
- on makeIndex keyChar1, keyChar2, keyPos
- global indexText, indexList
- set x to the number of lines in indexText
- cursor(4)
- set theCharNum to 97
- set indexList to EMPTY
- set omitIf to 0
- repeat with n = 1 to x
- if not omitIf = 1 then
- if char 1 of line n of indexText = keyChar1 then
- set startLine to n
- set omitIf to 1
- end if
- end if
- if char 1 of line n of indexText = keyChar2 then
- set endLine to n - 1
- exit repeat
- end if
- end repeat
- put startLine && endLine
- set nextChar to char keyPos of line startLine of indexText
- repeat with k = startLine to endLine
- repeat with n = startLine to endLine
- if char keyPos of line k of indexText = nextChar then
- set t to nextChar & "," & n
- put t & RETURN after indexList
- exit repeat
- end if
- end repeat
- set x to charToNum(nextChar)
- set nextChar to numToChar(x + 1)
- end repeat
- put indexList
- cursor(-1)
- end
-