home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / PLOT / SURFUTI3.ZIP / WRITEINI.INC < prev   
Encoding:
Text File  |  1991-09-28  |  2.3 KB  |  70 lines

  1. { This file is no longer used in SURFMODL, only for file conversion. }
  2. procedure WRITEINI;
  3. { Write the current settings into the INI file }
  4.  
  5. var Outfile: text;           { file to write to }
  6.     Notopen: boolean;        { flag file not open yet }
  7.     Ans: char;               { answer to user query }
  8.     Mat: integer;           { material # }
  9.     Lite: integer;           { light source # }
  10.  
  11. begin
  12.   assign (Outfile, Inifile);
  13.   Notopen := TRUE;
  14.   while (Notopen) do begin
  15.     {$I-}
  16.     rewrite (Outfile);
  17.     {$I+}
  18.     if (ioresult = 0) then
  19.       Notopen := FALSE
  20.     else begin
  21.       writeln ('Error writing file ', Inifile);
  22.       write ('Try again (Y/N)? ');
  23.       readln (Ans);
  24.       if (Ans = 'N') or (Ans = 'n') then
  25.         exit;
  26.     end; { if ioresult }
  27.   end; { while }
  28.  
  29.   writeln (Outfile, 4);               { version number of INI file }
  30.   writeln (Outfile, 1, ' ', GrSys + Grmode / 100.0);
  31.   writeln (Outfile, 2, ' ', Xeye, ' ', Yeye, ' ', Zeye);
  32.   writeln (Outfile, 3, ' ', Xfocal, ' ', Yfocal, ' ', Zfocal);
  33.   writeln (Outfile, 4, ' ', Magnify);
  34.   writeln (Outfile, 5, ' ', Viewtype);
  35.   { 6: Autoresolve removed }
  36.   for Mat := 1 to Nmatl do
  37.     writeln (Outfile, 7, ' ',Mat, ' ',R1[Mat],' ', R2[Mat],' ', R3[Mat], ' ',
  38.              Color[Mat], ' ',Ambient[Mat]);
  39.   for Lite := 1 to Nlite do
  40.     writeln (Outfile, 8, ' ',Lite, ' ', Xlite[Lite], ' ', Ylite[Lite], ' ',
  41.              Zlite[Lite], ' ',Intensity[Lite]);
  42. {  writeln (Outfile, 9, Ambient); }
  43.   if (Interpolate) then
  44.     writeln (Outfile, 10, ' ', Epsilon)
  45.   else
  46.     writeln (Outfile, 10, ' ', 0.0);
  47.   if (Shadowing) then
  48.     writeln (Outfile, 11, ' ',1)
  49.   else
  50.     writeln (Outfile, 11, ' ',0);
  51.   writeln (Outfile, 12, ' ', Ngraphchar);
  52.   writeln (Outfile, 13, ' ', Showaxes, ' ', Xaxislen, ' ', Yaxislen, ' ',
  53.            Zaxislen,' ', Axiscolor);
  54.   writeln (Outfile, 14, ' ', Nwindow);
  55.   if (Mono) then
  56.     writeln (Outfile, 15, ' ',Ncolors,' ', 1)
  57.   else
  58.     writeln (Outfile, 15, ' ',Ncolors,' ', 0);
  59.   if (Dorandom) then
  60.     writeln (Outfile, 16, ' ', Randshade)
  61.   else
  62.     writeln (Outfile, 16, ' ',0.0);
  63.   for Mat := 1 to Nmatl do
  64.     writeln (Outfile, 17, ' ',Mat, ' ',Redmax[Mat], ' ',Grnmax[Mat], 
  65.              ' ',Blumax[Mat]);
  66.   writeln (Outfile, 18, ' ', ShowAllBorders);
  67.   writeln (Outfile, 99);
  68.   close (Outfile);
  69. end; { procedure WRITEINI }
  70.