home *** CD-ROM | disk | FTP | other *** search
/ Sound, Music & MIDI Collection 2 / SMMVOL2.bin / DEMO / PRG / CIRCLES.ZIP / CI_MAIN.DIX / 00010_INI.ls < prev    next >
Encoding:
Text File  |  1995-05-01  |  7.3 KB  |  220 lines

  1. on load_ini
  2.   global fcommand, up_2ndch, up_lang, up_mdicha, up_mdinot, up_load, up_save, up_temp, up_override, up_mem, ver_ifile, up_cload, up_csave, up_mvol, up_svcnt, up_rncnt
  3.   set fcommand to EMPTY
  4.   set version_OK to 0
  5.   set file to FileIO(mnew, "read", the pathName & "CIRCLE.INI")
  6.   if not objectp(file) then
  7.     updateStage()
  8.     return 0
  9.     exit
  10.   end if
  11.   cur_busy()
  12.   set s to "Start"
  13.   repeat while 1
  14.     set s to file(mReadLine)
  15.     if s <> EMPTY then
  16.       if s <> RETURN then
  17.         set s to correct_s(s)
  18.         set lncmd to chars(s, 1, 1)
  19.         if lncmd = "-" then
  20.           if (s & RETURN) = ver_ifile then
  21.             set version_OK to 1
  22.           end if
  23.         else
  24.           if version_OK then
  25.             if value(chars(s, 2, 3)) <> 13 then
  26.               set lncmd to chars(s, 1, 5)
  27.               if lncmd = "LOAS=" then
  28.                 set up_load to chars(s, 6, length(s))
  29.               else
  30.                 if lncmd = "SAVS=" then
  31.                   set up_save to chars(s, 6, length(s))
  32.                 else
  33.                   if lncmd = "LOAC=" then
  34.                     set up_cload to chars(s, 6, length(s))
  35.                   else
  36.                     if lncmd = "SAVC=" then
  37.                       set up_csave to chars(s, 6, length(s))
  38.                     else
  39.                       if lncmd = "TEMP=" then
  40.                         set up_temp to chars(s, 6, length(s))
  41.                       else
  42.                         if lncmd = "MEMO=" then
  43.                           set up_mem to value(chars(s, 6, length(s)))
  44.                         else
  45.                           if lncmd = "MVOL=" then
  46.                             set up_mvol to value(chars(s, 6, length(s)))
  47.                           else
  48.                             if lncmd = "RCNT=" then
  49.                               set up_rncnt to value(chars(s, 6, length(s))) + 1
  50.                               if up_rncnt > 999 then
  51.                                 set rnsvcnt to 0
  52.                               end if
  53.                             else
  54.                               if lncmd = "LANG=" then
  55.                                 set up_lang to value(chars(s, 6, length(s)))
  56.                               else
  57.                                 if lncmd = "OVER=" then
  58.                                   set up_override to value(chars(s, 6, length(s)))
  59.                                 else
  60.                                   if lncmd = "MCHA=" then
  61.                                     set up_mdicha to value(chars(s, 6, length(s)))
  62.                                   else
  63.                                     if lncmd = "MNOT=" then
  64.                                       set up_mdinot to value(chars(s, 6, length(s)))
  65.                                     else
  66.                                       if lncmd = "MONO=" then
  67.                                         if value(chars(s, 6, 7)) = 2 then
  68.                                           set up_2ndch to 1
  69.                                         else
  70.                                           set up_2ndch to 0
  71.                                         end if
  72.                                       end if
  73.                                     end if
  74.                                   end if
  75.                                 end if
  76.                               end if
  77.                             end if
  78.                           end if
  79.                         end if
  80.                       end if
  81.                     end if
  82.                   end if
  83.                 end if
  84.               end if
  85.             end if
  86.           end if
  87.         end if
  88.       end if
  89.       next repeat
  90.     end if
  91.     exit repeat
  92.   end repeat
  93.   file(mdispose)
  94.   set up_svcnt to 0
  95.   if not version_OK then
  96.     alert(" CIRCLE.INI file corrupted or created by a previsious" & " version of CIRCLE elements. Using defaults.")
  97.     return 0
  98.   else
  99.     mem_update()
  100.     return 1
  101.   end if
  102. end
  103.  
  104. on save_ini
  105.   global fcommand, ver_ifile, up_2ndch, up_lang, up_mdicha, up_mdinot, up_load, up_save, up_temp, up_override, up_mem, up_cload, up_csave, up_mvol, up_svcnt, up_rncnt
  106.   set fcommand to EMPTY
  107.   set s to "Start"
  108.   set file to FileIO(mnew, "write", the pathName & "CIRCLE.INI")
  109.   if not objectp(file) then
  110.     exit
  111.   end if
  112.   cur_busy()
  113.   set s to ver_ifile
  114.   file(mWriteString, s)
  115.   set s to "LOAS=" & up_load & RETURN
  116.   file(mWriteString, s)
  117.   set s to "SAVS=" & up_save & RETURN
  118.   file(mWriteString, s)
  119.   set s to "LOAC=" & up_cload & RETURN
  120.   file(mWriteString, s)
  121.   set s to "SAVC=" & up_csave & RETURN
  122.   file(mWriteString, s)
  123.   set s to "TEMP=" & up_temp & RETURN
  124.   file(mWriteString, s)
  125.   set s to "MEMO=" & string(up_mem) & RETURN
  126.   file(mWriteString, s)
  127.   set s to "LANG=" & string(up_lang) & RETURN
  128.   file(mWriteString, s)
  129.   set s to "MVOL=" & string(up_mvol) & RETURN
  130.   file(mWriteString, s)
  131.   set s to "RCNT=" & string(up_rncnt) & RETURN
  132.   file(mWriteString, s)
  133.   set s to "MCHA=" & string(up_mdicha) & RETURN
  134.   file(mWriteString, s)
  135.   set s to "MNOT=" & string(up_mdinot) & RETURN
  136.   set the floatPrecision to 4
  137.   file(mWriteString, s)
  138.   set s to "OVER=" & string(up_override) & RETURN
  139.   file(mWriteString, s)
  140.   if up_2ndch then
  141.     set s to "MONO=1" & RETURN
  142.   else
  143.     set s to "MONO=2" & RETURN
  144.   end if
  145.   file(mWriteString, "--END" & RETURN & RETURN)
  146.   file(mdispose)
  147.   cur_on()
  148. end
  149.  
  150. on ini_show
  151.   global fcommand, ver_ifile, up_2ndch, up_mdicha, up_mdinot, up_load, up_save, up_temp, up_override, up_cload, up_csave, up_mem, up_lang
  152.   put "up_load       >" & up_load & "<"
  153.   put "up_Cload      >" & up_cload & "<"
  154.   put "up_save       >" & up_save & "<"
  155.   put "up_Csave      >" & up_csave & "<"
  156.   put "up_temp       >" & up_temp & "<"
  157.   put "up_override   >" & up_override & "<"
  158.   put "up_2ndch      >" & up_2ndch & "<"
  159.   put "up_mem        >" & up_mem & "<"
  160.   put "up_lang       >" & up_lang & "<"
  161.   put "up_mdicha     >" & up_mdicha
  162.   put "up_mdinot     >" & up_mdinot
  163. end
  164.  
  165. on chk_ini
  166.   global up_load, up_save, up_temp, up_override, up_mem, up_cload, up_csave
  167.   if not chk_dir(spath(up_load), getffpath(up_load)) then
  168.     set up_load to the pathName
  169.   end if
  170.   if not chk_dir(spath(up_save), getffpath(up_save)) then
  171.     set up_save to the pathName
  172.   end if
  173.   if not chk_dir(spath(up_cload), getffpath(up_cload)) then
  174.     set up_cload to the pathName
  175.   end if
  176.   if not chk_dir(spath(up_csave), getffpath(up_csave)) then
  177.     set up_csave to the pathName
  178.   end if
  179.   if not chk_dir(spath(up_temp), getffpath(up_temp)) then
  180.     set up_temp to the pathName
  181.   end if
  182. end
  183.  
  184. on spath up
  185.   if the machineType = 256 then
  186.     return getipath(up) & "*.*"
  187.   else
  188.     return getipath(up)
  189.   end if
  190. end
  191.  
  192. on ini_init
  193.   global up_2ndch, up_mdicha, up_mdinot, up_load, up_save, up_temp, enterFrame, up_cload, up_csave, up_mem, up_lang, up_mvol, up_svcnt, up_rncnt, up_override, demo
  194.   set up_save to the pathName
  195.   set up_load to the pathName
  196.   set up_csave to the pathName
  197.   set up_cload to the pathName
  198.   set up_temp to the pathName
  199.   if demo then
  200.     set up_save to the pathName
  201.     set up_csave to the pathName
  202.     if the machineType = 256 then
  203.       set up_load to the pathName & "SOUNDS\"
  204.       set up_cload to the pathName & "CIRCLES\"
  205.     else
  206.       set up_load to the pathName & "SOUNDS:"
  207.       set up_cload to the pathName & "CIRCLES:"
  208.     end if
  209.     set up_temp to the pathName
  210.   end if
  211.   set up_2ndch to 0
  212.   set up_override to 0.95999999999999996
  213.   set up_lang to 1
  214.   set up_mdicha to -1
  215.   set up_mdinot to 24
  216.   set up_mvol to 15
  217.   set up_svcnt to 0
  218.   set up_rncnt to 0
  219. end
  220.