home *** CD-ROM | disk | FTP | other *** search
- global gOpSys
-
- -- handler getTrackingInfo
- -- reads tracking file and appends contest information
- -- saves the result in global variables
- -- textStringBig and textStringLittle
- --
- -- Closely based on handler createContestForm
- --
- on getTrackingInfo
-
- global trackList
-
- set prefsPath = findPath()
-
- -- -- make sure the xtra is open
- -- set openLibs = xFactoryList(EMPTY)
- -- if NOT(openLibs contains "fileio") then
- -- set status = "getTrackingInfo: xtra not available"
- -- return status
- -- exit
- -- end if
-
- -- reads the prefs file
- -- include token TAB between each item
- set readObj = new(xtra "FileIO")
- if not objectP(readObj) then
- put "getTrackingInfo: object instantiation error"
- exit
- end if
-
- openFile(readObj, prefsPath&"Blendprf", 1)
-
- --
- -- read the file line by line... do not read more than
- -- 50 carriage return delimited lines so that
- -- the size of the printout is not too large
- --
- set thisLine = readLine(readObj)
- set lineCount = 1
- set OUTPUT = EMPTY
-
- repeat while (thisLine <> EMPTY) AND (lineCount <= 50)
- set OUTPUT = OUTPUT & thisLine
- set thisLine = readLine(readObj)
- set lineCount = lineCount + 1
- end repeat
-
- closeFile(readObj)
- set readObj = 0
-
- set disclaimer = "The following information tracks your viewing of Blender. ¬
- It is used to improve the product."
-
- set textString = disclaimer & RETURN & RETURN & OUTPUT
-
- return textString
-
- end getTrackingInfo
-
-
-
-
- --
- -- function saveToText
- --
- -- utility handler writes to a text file
- -- INPUT:
- -- > file_name type STRING: the name of the file
- -- > file_loc type SYMBOL: the location of the file
- -- #WINWIN the Windows directory
- -- #WINSYS the Windows/System directory
- -- #MACPRF the mac Preferences folder
- -- > file_cont type STRING: the contents of the file
- -- > file_mode type SYMBOL: the type of write
- -- #OVERWRITE replace previous contents, if any
- -- #APPEND append to previous contents, if any
- -- OUTPUT:
- -- < status type STRING: error checking variable
- -- "OK" file written correctly
- -- [error] string containing error type
- --
-
- on saveToText file_name, file_loc, file_cont, file_mode
-
- if paramCount() <> 4 then
- put "saveToText requires 4 parameters:"
- put "file_name, file_loc, file_cont, file_mode"
- set status = "parameter count error"
- return status
- exit
- end if
-
- if NOT( stringP(file_name) ) OR NOT( stringP(file_cont) )¬
- OR NOT(symbolP(file_loc) ) OR NOT( symbolP(file_mode) ) then
- set status = "saveToText: incorrect parameter type"
- return status
- exit
- end if
-
- -- -- make sure the xtra is open
- -- set openLibs = xFactoryList(EMPTY)
- -- if NOT(openLibs contains "fileio") then
- -- set status = "saveToText: xtra not available"
- -- return status
- -- exit
- -- end if
-
- if ((gOpSys = #WIN16) OR (gOpSys = #WIN32)) then
- set winMachine = TRUE
- else
- set winMachine = FALSE
- end if
-
- set sysPath = findPath()
-
- if (file_loc = #WINWIN) AND (winMachine = TRUE) then
- set filePath = sysPath & "\"
- else if (file_loc = #MACPRF) AND NOT(winMachine) then
- set filePath = sysPath & "\"
- else if (file_loc = #WINSYS) AND (winMachine = TRUE) then
- set filePath = sysPath & "\SYSTEM\"
- else
- set status = "file_loc error"
- return status
- exit
- end if
-
- if file_name = EMPTY then
- set status = "file_name EMPTY error"
- return status
- exit
- end if
-
- if file_cont = EMPTY then
- set status = "file_cont EMPTY error"
- return status
- exit
- end if
-
- if file_mode = #OVERWRITE then
- set writeObj = new(xtra "FileIO")
- openFile(writeObj, filePath & file_name, 2)
- delete(writeObj)
- createFile(writeObj, filePath & file_name)
- openFile(writeObj, filePath & file_name, 2)
- else if file_mode = #APPEND then
- set writeObj = new(xtra "FileIO")
- createFile(writeObj, filePath & file_name)
- openFile(writeObj, filePath & file_name, 2)
- set fileLen = getLength(writeObj)
- setPosition(writeObj,fileLen) -- set the position to the end of the file
- else
- set status = "file_mode error"
- return status
- exit
- end if
-
- if NOT( objectP(writeObj) ) then
- set status = "file creation error"
- return status
- exit
- end if
-
- writeString(writeObj, file_cont )
- closeFile(writeObj)
- set writeObj = 0
-
- set status = "OK"
- return status
-
- end saveToText
-
-
-
- --
- -- handler CopyAOL
- -- copies the America OnLine installer
- -- to the root directory of the user's hard drive.
- -- The installer should be located in the root of the Blender CD.
- -- Change Mac and Window installer names
- -- to suit actual file names.
- --
- on CopyAOL
- global SYSdrive
- global CDdrive
- global MX
-
-
- if the machineType = 256 then
- openXLib "MISC_X"
- else
- --openXLib CDdrive&"FILES:MISC_X XObj"
- end if
- if not objectp(MX) then set MX = misc_x(mnew)
-
- if the machineType = 256 then
- set fileName = "BLENDER\GNN\SETUP.EXE"
- set sourcePath = CDdrive & fileName
- set destPath = SYSdrive & "GNNBLEND\SETUP.EXE"
- put sourcePath, destPath
- set folderCheck = MX(mInsureFolder,SYSDrive&"GNNBLEND\")
- alert "Now copying GNN installation software"
- else
- -- set fileName = "America Online v2.6:Install AOL v2.6 w/Browser"
- -- set sourcePath = CDdrive & fileName
- -- set destPath = SYSdrive & fileName
- alert "This software is not for Macintosh computers!"
-
- end if
- if the machineType = 256 then
-
- set copyInst = MX(mCopyFile, sourcePath, destPath)
-
- if copyInst <> 1 then
- alert "We couldn't copy the GNN installer. ¬
- Sorry to make you do all the work, but drag it onto your hard drive from the CD-ROM."
- else
- alert "The installer has been successfully copied."
- end if
-
-
-
- if objectp(MX) then MX(mDispose)
- end if
-
- if the machineType = 256 then
- closeXLib "MISC_X"
- else
- --closeXLib CDdrive&"FILES:MISC_X XObj"
- end if
-
- end CopyAOL
-
-
- on techDirectorInit
- global volName, TRACKINGflag
- set volName = "3.4"
- set TRACKINGflag = false
- end techDirectorInit