home *** CD-ROM | disk | FTP | other *** search
- on getsyokimac
- global gsyokipath
- if factory("MovieUtilities") = 0 then
- openXLib(the pathName & "MovieUtilities.XObj")
- end if
- if objectp(utilobj) then
- utilobj(mdispose)
- end if
- set utilobj to movieutilities(mnew)
- if objectp(utilobj) then
- set gsyokipath to utilobj(mgetsystempath)
- else
- errorhandl()
- end if
- if objectp(utilobj) then
- utilobj(mdispose)
- end if
- closeXLib(the pathName & "MovieUtilities.XObj")
- set gsyokipath to gsyokipath & "èâä²ê›íË:" & "NORI-P1 Preferences"
- end
-
- on getsyokiwin
- global gsyokipath
- if factory("getwdir") = 0 then
- openXLib(the pathName & "getwdir")
- end if
- if objectp(utilobj) then
- utilobj(mdispose)
- end if
- set utilobj to getwdir(mnew)
- if objectp(utilobj) then
- set gsyokipath to utilobj(mwindir)
- else
- errorhandl()
- end if
- if objectp(utilobj) then
- utilobj(mdispose)
- end if
- closeXLib(the pathName & "getwdir")
- set gsyokipath to gsyokipath & "norip1.pre"
- end
-
- on gettextfile
- global gsyokipath
- if the machineType = 256 then
- getsyokiwin()
- else
- getsyokimac()
- end if
- set readobj to fileio(mnew, "read", gsyokipath)
- if objectp(readobj) = 0 then
- makepref()
- else
- readusef(readobj)
- end if
- end
-
- on errorhandl
- alert("ÉfÅ[É^ÇÃì«Ç›çûǛDžéÞîsǵNjǵÇý err0")
- setglobalonly()
- abort()
- end
-
- on setglobalonly
- global gflist, gftlist, gend
- set gflist to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- set gftlist to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- set gend to 0
- end
-
- on makepref
- setglobalonly()
- savenowinf()
- end
-
- on readusef readobj
- global gsyokipath, gflist, gftlist, gend
- set gflist to []
- repeat with n = 1 to 5
- set var to getAt([1, 7, 1, 10, 1], n)
- repeat with c = 1 to 5
- set oneline to readobj(mreadline)
- set lng to length(oneline)
- if char lng of oneline = RETURN then
- delete char lng of oneline
- end if
- if oneline = EMPTY then
- wrongdatah(readobj, 1)
- end if
- set num to value(oneline)
- if (num = 0) or (num = var) then
- append(gflist, num)
- next repeat
- end if
- wrongdatah(readobj, 2)
- end repeat
- end repeat
- set gftlist to []
- set alist to []
- repeat with n = 1 to 25
- set oneline to readobj(mreadline)
- set lng to length(oneline)
- if char lng of oneline = RETURN then
- delete char lng of oneline
- end if
- if oneline = EMPTY then
- wrongdatah(readobj, 3)
- end if
- set num to value(oneline)
- append(alist, num)
- append(gftlist, num)
- end repeat
- repeat with n = 0 to 4
- set blist to []
- repeat with c = 1 to 5
- append(blist, getAt(alist, (5 * c) - 4 + n))
- end repeat
- sort(blist)
- repeat with c = 1 to 5
- set num to getAt(blist, 1)
- if num = 0 then
- deleteAt(blist, 1)
- next repeat
- end if
- exit repeat
- end repeat
- repeat with c = 1 to count(blist)
- if c <> getAt(blist, c) then
- wrongdatah(readobj, 4)
- end if
- end repeat
- end repeat
- repeat with n = 1 to 25
- if ((getAt(gflist, n) = 0) and (getAt(gftlist, n) = 0)) or ((getAt(gflist, n) <> 0) and (getAt(gftlist, n) <> 0)) then
- nothing()
- next repeat
- end if
- wrongdatah(readobj, 5)
- end repeat
- set oneline to readobj(mreadline)
- set lng to length(oneline)
- if char lng of oneline = RETURN then
- delete char lng of oneline
- end if
- if oneline = EMPTY then
- wrongdatah(readobj, 6)
- end if
- set gend to value(oneline)
- if (gend <> 0) and (gend <> 1) then
- wrongdatah(readobj, 7)
- end if
- if (getOne(gflist, 0) <> 0) and (gend = 1) then
- wrongdatah(readobj, 8)
- end if
- readobj(mdispose)
- writecheck()
- end
-
- on wrongdatah readobj, num
- readobj(mdispose)
- alert("ÉfÅ[É^ÇÃì«Ç›çûǛDžéÞîsǵNjǵÇý err" & string(num))
- makepref()
- abort()
- end
-
- on writecheck
- global gsyokipath
- set writeobj to fileio(mnew, "append", gsyokipath)
- if objectp(writeobj) = 0 then
- errorhandl()
- end if
- set res to writeobj(mwritechar, charToNum(RETURN))
- writeobj(mdispose)
- if value(res) < 0 then
- errorhandl()
- end if
- end
-