home *** CD-ROM | disk | FTP | other *** search
- global vNewSUBlist
-
- on hBuildAttrib startcast, stopcast, namelist
- global Lattriblist
- set the itemDelimiter to "~"
- set Lattriblist to value(field ("ATTRIB_" & namelist))
- if not objectp(Lattriblist) then
- hReportStatus("Index not creatable from whatever is in field ATTRIB_" & namelist)
- hearit(gNopeSND)
- return
- end if
- repeat with n = startcast to stopcast
- put "Cast" && n
- set imax to the number of items in field n
- repeat with i = 1 to imax
- set Ltempchunk to item i of field n
- set the itemDelimiter to "@"
- set Ltempentryname to item 2 of Ltempchunk
- delete char 1 of Ltempentryname
- set Lpos to findPos(Lattriblist, Ltempentryname)
- if voidp(Lpos) then
- set Lpos to findPos(Lattriblist, hTryAltQuotes(Ltempentryname))
- if voidp(Lpos) then
- hputmsg("Couldnt find >" & Ltempentryname & "< in field ATTRIB_" & namelist)
- hputmsg("at item" && i && "in cast" && n)
- stall()
- end if
- end if
- set LtheseAttribs to getAt(Lattriblist, Lpos)
- setAt(LtheseAttribs, 1, 0)
- setAt(LtheseAttribs, 2, 0)
- setAt(LtheseAttribs, 3, 0)
- setAt(LtheseAttribs, 4, -1)
- setAt(LtheseAttribs, 5, 0)
- setAt(LtheseAttribs, 6, 0)
- setAt(LtheseAttribs, 7, 0)
- setAt(LtheseAttribs, 8, 1)
- setAt(LtheseAttribs, 9, n)
- setAt(LtheseAttribs, 10, i)
- setAt(Lattriblist, Lpos, LtheseAttribs)
- set the itemDelimiter to "~"
- end repeat
- end repeat
- put Lattriblist into field ("NEW_" & namelist)
- end
-
- on hTryAltQuotes thisname
- if char 1 of thisname = QUOTE then
- put "'" into char 1 of thisname
- put "'" into char length(thisname) of thisname
- end if
- return thisname
- end
-
- on hsizereport P1, p2
- repeat with i = P1 to p2
- if (the castType of cast i = #text) or (the castType of cast i = #script) then
- preLoadCast(i)
- put i && the name of cast i && "=" && the size of cast i / 1024 & "K bytes"
- if (the size of cast i / 1024) > 32 then
- put "FIX " && the name of cast i && "it has " & the size of cast i / 1024 & "K bytes"
- end if
- end if
- end repeat
- end
-
- on hUpdateCastTable
- put "CAST UPDATE BEGINS"
- set Lstart to 501
- set Lend to 999
- put "Scanning from cast" && Lstart && "to" && Lend
- set Ltemplist to [:]
- repeat with i = Lstart to Lend
- addProp(Ltemplist, i, the name of cast i)
- end repeat
- put Ltemplist into field "CastTable500"
- set Lstart to 1000
- set Lend to 1999
- put "Scanning from cast" && Lstart && "to" && Lend && "(start of the picons)."
- set Ltemplist to [:]
- repeat with i = Lstart to Lend
- addProp(Ltemplist, i, the name of cast i)
- end repeat
- put Ltemplist into field "CastTable1000"
- set Lstart to 2000
- set Lend to 2999
- put "Scanning from cast" && Lstart && "to" && Lend
- set Ltemplist to [:]
- repeat with i = Lstart to Lend
- addProp(Ltemplist, i, the name of cast i)
- end repeat
- put Ltemplist into field "CastTable2000"
- put "Adjusting internal data table... Doing step 1 of 3." into field "Status"
- put "Casts 'Casttable...' have been updated."
- put "'hAssembleScrollLists' now updating ATTRIB lists."
- hAssembleScrollLists()
- end
-
- on hAssembleScrollLists
- global gLastYearK
- if voidp(gLastYearK) then
- hputmsg("hAssembleScrollLists needs a value for gLastYearK")
- end if
- set Lthelist to []
- set Laccum to 0
- repeat with i = 65 to 90
- put "." after field "Status"
- set Ltemp to value(field ("ATTRIB_" & numToChar(i) & "_ENCY"))
- set Laccum to Laccum + count(Ltemp)
- append(Lthelist, Laccum)
- end repeat
- put Lthelist into field "ENCY_ScrollPoints"
- put "Adjusting internal data table... Doing step 2 of 3." into field "Status"
- put "Phew!"
- end
-
- on hMakeChroPoints
- global gLastYearK
- set Lthelist to []
- set Laccum to 0
- repeat with i = 1 to 17
- setAt(Lthelist, i, Laccum)
- end repeat
- repeat with i = 18 to 24
- put "." after field "Status"
- set Ltemp to value(field ("ATTRIB_" & string(i) & "_CHRO"))
- set Lsize to count(Ltemp)
- set Laccum to Laccum + count(Ltemp)
- append(Lthelist, Laccum)
- end repeat
- put Lthelist into field "CHRO_ScrollPoints"
- end
-
- on hStripOldChron pStart, pend
- repeat with Li = pStart to pend
- set Loldname to the name of cast Li
- set Lnewname to "NEW_" & Loldname
- set Lnewlist to [:]
- set Loldlist to value(field Li)
- if not objectp(Loldlist) then
- hReportStatus("Field" && Loldname && "didnt create a list.")
- hearit(gNopeSND)
- abort()
- end if
- set Lnumofmajoritems to count(Loldlist)
- repeat with Lj = 1 to Lnumofmajoritems
- set LanItem to getPropAt(Loldlist, Lj)
- put "Working on:" && LanItem
- set LitsValues to getAt(Loldlist, Lj)
- set Lhowmanyvals to count(LitsValues)
- repeat with lk = 1 to Lhowmanyvals
- set Lprevname to getPropAt(LitsValues, lk)
- if Lprevname <> LanItem then
- set LmyNewName to LanItem && Lprevname
- else
- set LmyNewName to Lprevname
- end if
- put "A new name:" && LmyNewName
- set LmyAttribs to getAt(LitsValues, lk)
- addProp(Lnewlist, LmyNewName, LmyAttribs)
- end repeat
- end repeat
- put Lnewlist into field Lnewname
- end repeat
- put "DONE."
- end
-
- on hFindEntD pFirstFieldNum, pLastFieldNum
- repeat with LthisFld = pFirstFieldNum to pLastFieldNum
- set the itemDelimiter to "~"
- set Lmax to the number of items in field LthisFld
- put "Looking in field" && LthisFld
- repeat with i = 1 to Lmax
- if item i of field LthisFld contains "Enterprise -D" then
- set Ltempfld to item i of field LthisFld
- set the itemDelimiter to "@"
- put item 2 of Ltempfld
- set the itemDelimiter to "~"
- end if
- end repeat
- put "Finished with field" && LthisFld
- end repeat
- put "ALL DONE."
- end
-
- on builddirlist atpath
- set thefileList to []
- repeat with i = 1 to the maxinteger
- set n to getNthFileNameInFolder(atpath, i)
- if n = EMPTY then
- exit repeat
- end if
- append(thefileList, n)
- end repeat
- return thefileList
- end
-