home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 July / macformat-039.iso / DATABASE / SHARED.DIR / 01011.ls < prev    next >
Encoding:
Text File  |  1996-03-14  |  2.1 KB  |  76 lines

  1. on GetPeople
  2.   global mpath
  3.   set ftype to "txt"
  4.   set fileList to []
  5.   repeat with i = 1 to the maxinteger
  6.     set n to getNthFileNameInFolder(mpath, i)
  7.     if n = EMPTY then
  8.       exit repeat
  9.     end if
  10.     set the itemDelimiter to "."
  11.     if item 2 of n = ftype then
  12.       if (the number of chars in n > 4) or ((the number of chars in n = 4) and (char 1 to 2 of n <> "CU") and (char 1 to 2 of n <> "SC")) then
  13.         append(fileList, item 1 of n)
  14.       end if
  15.     end if
  16.     set the itemDelimiter to ","
  17.   end repeat
  18.   set num to count(fileList)
  19.   set txtfilelist to []
  20.   repeat with i = 1 to num
  21.     set tmp to getAt(fileList, i)
  22.     set tmpnum to Bsearch(tmp, "MakerList")
  23.     if tmpnum > 0 then
  24.       put tmp into item 3 of line tmpnum of field "MakerFileNames"
  25.       next repeat
  26.     end if
  27.     put "problem with: " && tmp
  28.   end repeat
  29.   if 1 then
  30.     set the text of field "Filenames" to " "
  31.     set the text of field "Filenames2" to " "
  32.     if num > 25 then
  33.       repeat with i = 1 to 25
  34.         set tmp to getAt(fileList, i)
  35.         put item 1 of tmp into line the number of lines in field "filenames" + 1 of field "Filenames"
  36.       end repeat
  37.       repeat with i = 26 to num
  38.         set tmp to getAt(fileList, i)
  39.         put item 1 of tmp into line the number of lines in field "filenames2" + 1 of field "Filenames2"
  40.       end repeat
  41.     else
  42.       repeat with i = 1 to num
  43.         set tmp to getAt(fileList, i)
  44.         put item 1 of tmp into line the number of lines in field "filenames" + 1 of field "Filenames"
  45.       end repeat
  46.     end if
  47.   end if
  48. end
  49.  
  50. on DoIndex
  51.   global mpath
  52.   set fileList to []
  53.   repeat with i = 1 to the maxinteger
  54.     set n to getNthFileNameInFolder(mpath, i)
  55.     if n = EMPTY then
  56.       exit repeat
  57.     end if
  58.     append(fileList, n)
  59.   end repeat
  60.   set num to count(fileList)
  61.   set txtfilelist to []
  62.   repeat with i = 1 to num
  63.     set tmp to getAt(fileList, i)
  64.     set the itemDelimiter to "."
  65.     if item 2 of tmp = "TXT" then
  66.       add(txtfilelist, tmp)
  67.     end if
  68.     set the itemDelimiter to ","
  69.   end repeat
  70.   put txtfilelist
  71.   set num to count(txtfilelist)
  72.   repeat with i = 1 to num
  73.     MakeIndex(getAt(txtfilelist, i))
  74.   end repeat
  75. end
  76.