MACROMEDIA DIRECTOR MX 2004-GETTING STARTED WITH DIRECTOR Uživatelský manuál Strana 37

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 63
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 36
Use the list commands to index Director text chunks for operations where you otherwise would
have to refer back to the text itself. For instance you can use GetListOfWords to speed up a
proximity search (word 1 within so many words of word 2). List commands like:
if getAt(wordList,5) = secondword
are faster than text chunk commands like:
if word 5 of field "whatever" = secondword
GetListOfWords(sourceString) - where sourceString is the string to operate on. Returns a list of
character chunks delimited by white space or empty list if there was an error. Returns a list of
character chunks in the string delimited by white space. White space includes TAB(9),
Linefeed(10) and Return(13).
Example:
on makeIndex thestring
-- Create an alphabetical index of the words
-- in a text chunk
--
set index = [:]
set thestring = ToLowerCase(thestring)
set wordList = GetListOfWords(thestring)
if TC_GetLastError() = 0 then
set numWords = count(wordList)
repeat with w = 1 to numWords
set thisword = getAt(wordList,w)
if voidP(getaprop(index,thisword)) then
addprop index,thisword,list(w)
Online Help
37
Zobrazit stránku 36
1 2 ... 32 33 34 35 36 37 38 39 40 41 42 ... 62 63

Komentáře k této Příručce

Žádné komentáře