home *** CD-ROM | disk | FTP | other *** search
- global previous, current
-
- on unity list1, list2
- set tempVec1 to the value of field list1
- set tempvec2 to the value of field list2
- set counter1 to count(tempVec1)
- set counter2 to count(tempvec2)
- repeat with i = 1 to counter2
- set x to getAt(tempvec2, i)
- if getOne(tempVec1, x) = 0 then
- add(tempVec1, x)
- end if
- end repeat
- put tempVec1 into field list1
- end
-
- on unity2 tempVec1, tempvec2
- set counter1 to count(tempVec1)
- set counter2 to count(tempvec2)
- repeat with i = 1 to counter2
- set x to getAt(tempvec2, i)
- if getOne(tempVec1, x) = 0 then
- add(tempVec1, x)
- end if
- end repeat
- set current to tempVec1
- end
-
- on divide
- global itemsFound
- set previous to []
- set current to []
- set itemsFound to 0
- set divideVec to ["whenCurr", "howCurr", "alcoCurr", "non-alcoCurr", "otherCurr"]
- repeat with i = 1 to 5
- if the text of field getAt(divideVec, i) <> "[]" then
- set previous to the value of field getAt(divideVec, i)
- repeat with j = i + 1 to 5
- if the text of field getAt(divideVec, j) <> "[]" then
- set list2 to the value of field getAt(divideVec, j)
- division(previous, list2)
- end if
- end repeat
- exit repeat
- end if
- end repeat
- if (count(previous) = 0) and (itemsFound > 0) then
- else
- set emptyCount to 0
- repeat with i = 123 to 127
- if the text of member i of castLib "lists" = "[]" then
- set emptyCount to emptyCount + 1
- end if
- end repeat
- if emptyCount = 5 then
- set previous to value(field "fullList")
- end if
- end if
- if count(current) = 0 then
- set current to previous
- end if
- end
-
- on division list1, list2
- global itemsFound
- set current to []
- set itemsFoundNow to 0
- set counter2 to count(list2)
- repeat with i = 1 to counter2
- set x to getAt(list2, i)
- if getPos(list1, x) <> 0 then
- set itemsFoundNow to itemsFoundNow + 1
- add(current, x)
- end if
- end repeat
- set previous to current
- set itemsFound to itemsFound + itemsFoundNow
- end
-
- on dissension list1, list2
- set tempVec1 to value(field list1)
- set tempvec2 to value(field list2)
- set counter2 to count(tempvec2)
- repeat with i = 1 to counter2
- set itemToDelete to getAt(tempvec2, i)
- set currPos to getOne(tempVec1, itemToDelete)
- if currPos > 0 then
- deleteAt(tempVec1, currPos)
- end if
- end repeat
- put tempVec1 into field list1
- end
-
- on colorRoutine
- global CompVec
- if CompVec = EMPTY then
- set CompVec to []
- end if
- set counter to count(CompVec)
- set currVec to ["alco", "non-alco", "other", "total", "when", "how"]
- repeat with i = 1 to counter
- set curr to getAt(CompVec, i)
- set x to the number of chars in curr
- set currF to char 1 to x - 1 of curr
- set y to getPos(currVec, currF)
- if y > 0 then
- set listNum to value(char x of curr)
- set listName to currF
- else
- set listNum to value(char x - 1 to x of currF)
- set listName to char 1 to x - 2 of currF
- end if
- set the foreColor of line listNum of field ("query-" & listName) to 35
- end repeat
- end
-
- on dup1 x
- set k to 1
- repeat with i = 2 to 174
- duplicate(member "note1", i + 200)
- set the name of member (i + 200) to "note" & i
- end repeat
- end
-
- on dup2
- repeat with i = 1 to 51
- duplicate(member 100, i + 100)
- set the name of member (i + 100) to "alco" & i
- end repeat
- repeat with i = 1 to 16
- duplicate(member 100, i + 158)
- set the name of member (i + 158) to "non-alco" & i
- end repeat
- repeat with i = 1 to 21
- duplicate(member 100, i + 186)
- set the name of member (i + 186) to "other" & i
- end repeat
- end
-
- on check
- repeat with i = 1 to the number of lines in the text of field "Dat3"
- if char 1 of line i of the text of field "Dat3" = "-" then
- put integer(i / 32) + 116 && i / 32.0
- end if
- end repeat
- end
-
- on cleanslashes
- repeat with i = 1 to the number of lines in field "names"
- set x to offset("/", line i of field "names")
- set y to char 1 to x - 2 of line i of field "names"
- put y into line i of field "names"
- end repeat
- end
-
- on checkAdjustment
- repeat with i = 1 to 174
- put line 25 of the text of member ("recipe" & i)
- end repeat
- end
-
- on compare
- repeat with i = 1 to the number of lines in the text of member "other"
- set x to line i of the text of member "other"
- if the text of member "alco" contains x then
- put x & " alco"
- end if
- if the text of member "non-alco" contains x then
- put x & " non"
- end if
- end repeat
- end
-
- on fillFull
- repeat with i = 1 to the number of lines in field "names"
- put i into item i of field "fullList"
- end repeat
- end
-
- on changeToVecs
- repeat with i = 2 to 102
- set the text of field i of castLib "lists" to "[" & the text of field i of castLib "lists" & "]"
- end repeat
- end
-