home *** CD-ROM | disk | FTP | other *** search
/ Car Screensaver - Toyota / TOYOTA.iso / mjparty / no1_demo / dnorp00.dxr / script_29.ls < prev    next >
Encoding:
Text File  |  1996-10-31  |  4.1 KB  |  178 lines

  1. on getsyokimac
  2.   global gsyokipath
  3.   if factory("MovieUtilities") = 0 then
  4.     openXLib(the pathName & "MovieUtilities.XObj")
  5.   end if
  6.   if objectp(utilobj) then
  7.     utilobj(mdispose)
  8.   end if
  9.   set utilobj to movieutilities(mnew)
  10.   if objectp(utilobj) then
  11.     set gsyokipath to utilobj(mgetsystempath)
  12.   else
  13.     errorhandl()
  14.   end if
  15.   if objectp(utilobj) then
  16.     utilobj(mdispose)
  17.   end if
  18.   closeXLib(the pathName & "MovieUtilities.XObj")
  19.   set gsyokipath to gsyokipath & "├¿├ó├ñ┬▓├¬ΓÇ║├¡├ï:" & "NORI-P1 Preferences"
  20. end
  21.  
  22. on getsyokiwin
  23.   global gsyokipath
  24.   if factory("getwdir") = 0 then
  25.     openXLib(the pathName & "getwdir")
  26.   end if
  27.   if objectp(utilobj) then
  28.     utilobj(mdispose)
  29.   end if
  30.   set utilobj to getwdir(mnew)
  31.   if objectp(utilobj) then
  32.     set gsyokipath to utilobj(mwindir)
  33.   else
  34.     errorhandl()
  35.   end if
  36.   if objectp(utilobj) then
  37.     utilobj(mdispose)
  38.   end if
  39.   closeXLib(the pathName & "getwdir")
  40.   set gsyokipath to gsyokipath & "norip1.pre"
  41. end
  42.  
  43. on gettextfile
  44.   global gsyokipath
  45.   if the machineType = 256 then
  46.     getsyokiwin()
  47.   else
  48.     getsyokimac()
  49.   end if
  50.   set readobj to fileio(mnew, "read", gsyokipath)
  51.   if objectp(readobj) = 0 then
  52.     makepref()
  53.   else
  54.     readusef(readobj)
  55.   end if
  56. end
  57.  
  58. on errorhandl
  59.   alert("├ëf├à[├ë^├ç├â├¼┬½├çΓÇ║├º├╗├çΓÇ║├çΓǪ├⌐├₧├«s├ç┬╡├çΓÇ╣├ç┬╡├ç├╜ err0")
  60.   setglobalonly()
  61.   abort()
  62. end
  63.  
  64. on setglobalonly
  65.   global gflist, gftlist, gend
  66.   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]
  67.   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]
  68.   set gend to 0
  69. end
  70.  
  71. on makepref
  72.   setglobalonly()
  73.   savenowinf()
  74. end
  75.  
  76. on readusef readobj
  77.   global gsyokipath, gflist, gftlist, gend
  78.   set gflist to []
  79.   repeat with n = 1 to 5
  80.     set var to getAt([1, 7, 1, 10, 1], n)
  81.     repeat with c = 1 to 5
  82.       set oneline to readobj(mreadline)
  83.       set lng to length(oneline)
  84.       if char lng of oneline = RETURN then
  85.         delete char lng of oneline
  86.       end if
  87.       if oneline = EMPTY then
  88.         wrongdatah(readobj, 1)
  89.       end if
  90.       set num to value(oneline)
  91.       if (num = 0) or (num = var) then
  92.         append(gflist, num)
  93.         next repeat
  94.       end if
  95.       wrongdatah(readobj, 2)
  96.     end repeat
  97.   end repeat
  98.   set gftlist to []
  99.   set alist to []
  100.   repeat with n = 1 to 25
  101.     set oneline to readobj(mreadline)
  102.     set lng to length(oneline)
  103.     if char lng of oneline = RETURN then
  104.       delete char lng of oneline
  105.     end if
  106.     if oneline = EMPTY then
  107.       wrongdatah(readobj, 3)
  108.     end if
  109.     set num to value(oneline)
  110.     append(alist, num)
  111.     append(gftlist, num)
  112.   end repeat
  113.   repeat with n = 0 to 4
  114.     set blist to []
  115.     repeat with c = 1 to 5
  116.       append(blist, getAt(alist, (5 * c) - 4 + n))
  117.     end repeat
  118.     sort(blist)
  119.     repeat with c = 1 to 5
  120.       set num to getAt(blist, 1)
  121.       if num = 0 then
  122.         deleteAt(blist, 1)
  123.         next repeat
  124.       end if
  125.       exit repeat
  126.     end repeat
  127.     repeat with c = 1 to count(blist)
  128.       if c <> getAt(blist, c) then
  129.         wrongdatah(readobj, 4)
  130.       end if
  131.     end repeat
  132.   end repeat
  133.   repeat with n = 1 to 25
  134.     if ((getAt(gflist, n) = 0) and (getAt(gftlist, n) = 0)) or ((getAt(gflist, n) <> 0) and (getAt(gftlist, n) <> 0)) then
  135.       nothing()
  136.       next repeat
  137.     end if
  138.     wrongdatah(readobj, 5)
  139.   end repeat
  140.   set oneline to readobj(mreadline)
  141.   set lng to length(oneline)
  142.   if char lng of oneline = RETURN then
  143.     delete char lng of oneline
  144.   end if
  145.   if oneline = EMPTY then
  146.     wrongdatah(readobj, 6)
  147.   end if
  148.   set gend to value(oneline)
  149.   if (gend <> 0) and (gend <> 1) then
  150.     wrongdatah(readobj, 7)
  151.   end if
  152.   if (getOne(gflist, 0) <> 0) and (gend = 1) then
  153.     wrongdatah(readobj, 8)
  154.   end if
  155.   readobj(mdispose)
  156.   writecheck()
  157. end
  158.  
  159. on wrongdatah readobj, num
  160.   readobj(mdispose)
  161.   alert("├ëf├à[├ë^├ç├â├¼┬½├çΓÇ║├º├╗├çΓÇ║├çΓǪ├⌐├₧├«s├ç┬╡├çΓÇ╣├ç┬╡├ç├╜ err" & string(num))
  162.   makepref()
  163.   abort()
  164. end
  165.  
  166. on writecheck
  167.   global gsyokipath
  168.   set writeobj to fileio(mnew, "append", gsyokipath)
  169.   if objectp(writeobj) = 0 then
  170.     errorhandl()
  171.   end if
  172.   set res to writeobj(mwritechar, charToNum(RETURN))
  173.   writeobj(mdispose)
  174.   if value(res) < 0 then
  175.     errorhandl()
  176.   end if
  177. end
  178.