home *** CD-ROM | disk | FTP | other *** search
/ Cocktail Hour / image.iso / COCKTAIL.DIR / Internal_50.ls < prev    next >
Encoding:
Text File  |  1997-03-05  |  4.7 KB  |  185 lines

  1. global previous, current
  2.  
  3. on unity list1, list2
  4.   set tempVec1 to the value of field list1
  5.   set tempvec2 to the value of field list2
  6.   set counter1 to count(tempVec1)
  7.   set counter2 to count(tempvec2)
  8.   repeat with i = 1 to counter2
  9.     set x to getAt(tempvec2, i)
  10.     if getOne(tempVec1, x) = 0 then
  11.       add(tempVec1, x)
  12.     end if
  13.   end repeat
  14.   put tempVec1 into field list1
  15. end
  16.  
  17. on unity2 tempVec1, tempvec2
  18.   set counter1 to count(tempVec1)
  19.   set counter2 to count(tempvec2)
  20.   repeat with i = 1 to counter2
  21.     set x to getAt(tempvec2, i)
  22.     if getOne(tempVec1, x) = 0 then
  23.       add(tempVec1, x)
  24.     end if
  25.   end repeat
  26.   set current to tempVec1
  27. end
  28.  
  29. on divide
  30.   global itemsFound
  31.   set previous to []
  32.   set current to []
  33.   set itemsFound to 0
  34.   set divideVec to ["whenCurr", "howCurr", "alcoCurr", "non-alcoCurr", "otherCurr"]
  35.   repeat with i = 1 to 5
  36.     if the text of field getAt(divideVec, i) <> "[]" then
  37.       set previous to the value of field getAt(divideVec, i)
  38.       repeat with j = i + 1 to 5
  39.         if the text of field getAt(divideVec, j) <> "[]" then
  40.           set list2 to the value of field getAt(divideVec, j)
  41.           division(previous, list2)
  42.         end if
  43.       end repeat
  44.       exit repeat
  45.     end if
  46.   end repeat
  47.   if (count(previous) = 0) and (itemsFound > 0) then
  48.   else
  49.     set emptyCount to 0
  50.     repeat with i = 123 to 127
  51.       if the text of member i of castLib "lists" = "[]" then
  52.         set emptyCount to emptyCount + 1
  53.       end if
  54.     end repeat
  55.     if emptyCount = 5 then
  56.       set previous to value(field "fullList")
  57.     end if
  58.   end if
  59.   if count(current) = 0 then
  60.     set current to previous
  61.   end if
  62. end
  63.  
  64. on division list1, list2
  65.   global itemsFound
  66.   set current to []
  67.   set itemsFoundNow to 0
  68.   set counter2 to count(list2)
  69.   repeat with i = 1 to counter2
  70.     set x to getAt(list2, i)
  71.     if getPos(list1, x) <> 0 then
  72.       set itemsFoundNow to itemsFoundNow + 1
  73.       add(current, x)
  74.     end if
  75.   end repeat
  76.   set previous to current
  77.   set itemsFound to itemsFound + itemsFoundNow
  78. end
  79.  
  80. on dissension list1, list2
  81.   set tempVec1 to value(field list1)
  82.   set tempvec2 to value(field list2)
  83.   set counter2 to count(tempvec2)
  84.   repeat with i = 1 to counter2
  85.     set itemToDelete to getAt(tempvec2, i)
  86.     set currPos to getOne(tempVec1, itemToDelete)
  87.     if currPos > 0 then
  88.       deleteAt(tempVec1, currPos)
  89.     end if
  90.   end repeat
  91.   put tempVec1 into field list1
  92. end
  93.  
  94. on colorRoutine
  95.   global CompVec
  96.   if CompVec = EMPTY then
  97.     set CompVec to []
  98.   end if
  99.   set counter to count(CompVec)
  100.   set currVec to ["alco", "non-alco", "other", "total", "when", "how"]
  101.   repeat with i = 1 to counter
  102.     set curr to getAt(CompVec, i)
  103.     set x to the number of chars in curr
  104.     set currF to char 1 to x - 1 of curr
  105.     set y to getPos(currVec, currF)
  106.     if y > 0 then
  107.       set listNum to value(char x of curr)
  108.       set listName to currF
  109.     else
  110.       set listNum to value(char x - 1 to x of currF)
  111.       set listName to char 1 to x - 2 of currF
  112.     end if
  113.     set the foreColor of line listNum of field ("query-" & listName) to 35
  114.   end repeat
  115. end
  116.  
  117. on dup1 x
  118.   set k to 1
  119.   repeat with i = 2 to 174
  120.     duplicate(member "note1", i + 200)
  121.     set the name of member (i + 200) to "note" & i
  122.   end repeat
  123. end
  124.  
  125. on dup2
  126.   repeat with i = 1 to 51
  127.     duplicate(member 100, i + 100)
  128.     set the name of member (i + 100) to "alco" & i
  129.   end repeat
  130.   repeat with i = 1 to 16
  131.     duplicate(member 100, i + 158)
  132.     set the name of member (i + 158) to "non-alco" & i
  133.   end repeat
  134.   repeat with i = 1 to 21
  135.     duplicate(member 100, i + 186)
  136.     set the name of member (i + 186) to "other" & i
  137.   end repeat
  138. end
  139.  
  140. on check
  141.   repeat with i = 1 to the number of lines in the text of field "Dat3"
  142.     if char 1 of line i of the text of field "Dat3" = "-" then
  143.       put integer(i / 32) + 116 && i / 32.0
  144.     end if
  145.   end repeat
  146. end
  147.  
  148. on cleanslashes
  149.   repeat with i = 1 to the number of lines in field "names"
  150.     set x to offset("/", line i of field "names")
  151.     set y to char 1 to x - 2 of line i of field "names"
  152.     put y into line i of field "names"
  153.   end repeat
  154. end
  155.  
  156. on checkAdjustment
  157.   repeat with i = 1 to 174
  158.     put line 25 of the text of member ("recipe" & i)
  159.   end repeat
  160. end
  161.  
  162. on compare
  163.   repeat with i = 1 to the number of lines in the text of member "other"
  164.     set x to line i of the text of member "other"
  165.     if the text of member "alco" contains x then
  166.       put x & " alco"
  167.     end if
  168.     if the text of member "non-alco" contains x then
  169.       put x & " non"
  170.     end if
  171.   end repeat
  172. end
  173.  
  174. on fillFull
  175.   repeat with i = 1 to the number of lines in field "names"
  176.     put i into item i of field "fullList"
  177.   end repeat
  178. end
  179.  
  180. on changeToVecs
  181.   repeat with i = 2 to 102
  182.     set the text of field i of castLib "lists" to "[" & the text of field i of castLib "lists" & "]"
  183.   end repeat
  184. end
  185.