home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / EDSCREEN.ZIP / EDCONFIG.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1979-12-31  |  24.1 KB  |  784 lines

  1. (*****************************************************************************)
  2. (*                                                                           *)
  3. (*                   F U L L   S C R E E N   E D I T O R                     *)
  4. (*                                                                           *)
  5. (*                           By Martine Wedlake                              *)
  6. (*                                                                           *)
  7. (*       This  programme  may be copied,  or modified in  any way  for non-  *)
  8. (*  commercial uses.  If you would like to use this programme in a business  *)
  9. (*  environment please write  me for licencing,  and so I can keep track of  *)
  10. (*  its success.   If you like this programme a  donation would  be awfully  *)
  11. (*  nice of you.  Thanks!                                                    *)
  12. (*                                Martine Wedlake                            *)
  13. (*                                4551 N.E. Simpson St.                      *)
  14. (*                                Portland Or                                *)
  15. (*                                97218                                      *)
  16. (*                                                                           *)
  17. (*****************************************************************************)
  18.  
  19. program configure_editor;
  20. {U-}
  21. {C-}
  22. type
  23.   str64=string[64];
  24.   string_of_80=string[80];
  25.   string_of_255=string[255];
  26.   config=record
  27.            graphic_letters:array[1..19,1..8] of char;
  28.            insert_mode:boolean;
  29.            help:boolean;
  30.            forg:integer;
  31.            back:integer;
  32.            Help_path:str64;
  33.          end;
  34. var
  35.   f_configure:file of config;
  36.   configure:config;
  37.  
  38. procedure center(stringy:string_of_80);{-----this centers a line of text}
  39.  
  40. { Centers a line of text at the present Y co-ordinate.}
  41.  
  42. var
  43.   endpos:integer;
  44. begin
  45.   gotoxy(40-length(stringy) div 2,wherey);  {goto position}
  46.   write(stringy);                           {write string}
  47. end;                                        {end of center procedure}
  48.  
  49. procedure border(x,y,x2,y2,forg,{------------This makes a lined border}
  50.                  back:integer;
  51.                  double:boolean);
  52.  
  53. { Border will put a double or single lined border by specifying the top left
  54.   and bottom left co-ordinates for the border.  x,y is the co-ordinate of the
  55.   top left.  x2,y2 is the co-ordinate of the bottom right.  Forg is the
  56.   forground colour, while Back is the background colour.  If double is true
  57.   the border will be a double line.  If it is false, then it will be a single
  58.   line border.}
  59.  
  60. var
  61.   old_x,
  62.   old_y,
  63.   loop:integer;
  64.   top_left,
  65.   top_right,
  66.   bot_left,
  67.   bot_right,
  68.   accross,
  69.   down:char;
  70. BEGIN
  71.   if (x2<x) or (y2<y) or (y>24) or (x>80)   {check to see that parameters valid}
  72.             or (y<1) or (x<1) then
  73.   begin                                     {if not valid then write error}
  74.     clrscr;
  75.     textcolor(white);
  76.     textbackground(black);
  77.     writeln('ERROR in procedure boarder.  Co-ordanates incorrect.');
  78.     halt;
  79.   end;
  80.   old_x:=wherex;                            {remember x,y of currsor}
  81.   old_y:=wherey;
  82.   TextColor(forg);                          {set the colours to be used}
  83.   textbackground(back);
  84.   if double then                            {assign the various characters for}
  85.   begin                                     {corners, vertical, and horizontal}
  86.     top_left:=#201;                         {lines}
  87.     top_right:=#187;
  88.     bot_left:=#200;
  89.     bot_right:=#188;
  90.     accross:=#205;
  91.     down:=#186;
  92.   end
  93.   else
  94.   begin                                     {For single lines}
  95.     top_left:=#218;
  96.     top_right:=#191;
  97.     bot_left:=#192;
  98.     bot_right:=#217;
  99.     accross:=#196;
  100.     down:=#179;
  101.   end;
  102.   gotoxy(x,y);
  103.   WRITE(top_left);                          {output the corner pieces}
  104.   gotoxy(x2,y);
  105.   WRITELN(top_right);
  106.   gotoxy(x,y2);
  107.   WRITE(bot_left);
  108.   gotoxy(x2,y2);
  109.   WRITE(bot_right);
  110.   FOR loop:=x+1 TO x2-1 DO                 {loop for the horz. line}
  111.   begin
  112.     gotoxy(loop,y);
  113.     WRITE(accross);
  114.     gotoxy(loop,y2);
  115.     write(accross);
  116.   end;
  117.   for loop:=y+1 to y2-1 do                  {loop for the vert. lines}
  118.   begin
  119.     gotoxy(x,loop);
  120.     WRITE(down);
  121.     gotoxy(x2,loop);
  122.     write(down);
  123.   end;
  124.   gotoxy(old_x,old_y);                      {restore cursor pos}
  125.   textcolor(white);                         {set colour to "normal"}
  126.   textbackground(black);
  127. END;
  128.  
  129. PROCEDURE title(title1:string_of_80);{-------this prints out the title}
  130.  
  131. { Title prints out a nice title with the title automatically centered
  132.   on the screen and with a border around it.  Use title(name)  where the
  133.   title you want to print is name.  Name must be a string.  It can be any
  134.   length. }
  135.  
  136. VAR
  137.   loop,                                     {a loop counter}
  138.   string_length,                            {the length of the title string}
  139.   x_position:INTEGER;                       {the position for centering title}
  140. BEGIN
  141.   ClrScr;
  142.   GotoXY(1,3);
  143.   TextColor(white);                         {title is in white}
  144.   Center(title1);                           {write title out}
  145.   string_length:=LENGTH(title1);            {assigns the length of title}
  146.   x_position:=40-(string_length DIV 2)-1;
  147.   border(x_position,2,x_position+string_length+1,
  148.          4,lightblue,black,true);
  149.   TextColor(lightblue);                     {frame is lightblue}
  150.   gotoxy(1,6);
  151. END;
  152.  
  153. PROCEDURE cursor(on:BOOLEAN);{---------------This sets the cursor on/off}
  154.  
  155. {procedure cursor will set the cursor on or off depending if the argument sent
  156.  is true or false.  If the argument is false the cursor will be turned off,
  157.  if the argument is true the cursor is the cursor is turned on.}
  158.  
  159. CONST
  160.   video_io=$10;                             {this is the interrupt number}
  161. VAR
  162.   regs:RECORD CASE INTEGER OF               {this sets up the registers}
  163.                 1: (AX,BX,CX,DX,BP,DI,SI,DS,ES,Flags: INTEGER);
  164.                 2: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
  165.               END;
  166. BEGIN
  167.   IF on THEN                                {if the user wants a cursor then}
  168.   BEGIN
  169.     regs.ch:=$06;                           {set the registers up for display}
  170.     regs.cl:=$07;                           {ch = start line, cl = end line}
  171.   END
  172.   ELSE                                      {else, the cursor is not displayed}
  173.   BEGIN
  174.     regs.ch:=$20;                           {set the register up for non-}
  175.     regs.cl:=$00;                           {display, ch=$20 doesn't display}
  176.   END;
  177.   regs.ah:=$01;
  178.   regs.al:=$00;
  179.   Intr(video_io,regs);
  180. END;
  181.  
  182. PROCEDURE waitkey;{--------------------------Press any key to continue proc.}
  183.  
  184. { This is a very simple but useful procedure to wait for a keypress to
  185.   continue with the program.}
  186.  
  187. VAR
  188.   key:CHAR;
  189. BEGIN
  190.   cursor(FALSE);                            {turn cursor off}
  191.   GotoXY(1,25);                             {set colour and position}
  192.   TextColor(black);
  193.   TextBackGround(white);
  194.   center('Press any key to continue with program.');{write message}
  195.   REPEAT UNTIL KeyPressed;                  {wait for key}
  196.   READ(Kbd,key);                            {store the key so it won't}
  197.   GotoXY(1,25);                             {screw up the next read(kbd)}
  198.   TextColor(white);                         {restore colour}
  199.   TextBackGround(black);
  200.   DelLine;                                  {erase message}
  201.   cursor(TRUE);                             {restore cursor}
  202. END;                                        {end of the waitkey procedure}
  203.  
  204.  
  205. function upstring(str:string_of_255){------returns uppercase strings}
  206.                   :string_of_255;
  207.  
  208. { This will take a string and return it's uppercase counterpart.}
  209.  
  210. var
  211.   temp_str:string_of_255;
  212.   temp:integer;
  213. begin
  214.   temp:=1;                                 {initialize the counter variable}
  215.   temp_str:='';                            {initialize the dummy string}
  216.   for temp:=1 to length(str) do            {loop and set it to upper case}
  217.   temp_str:=temp_str+upcase(copy(str,temp,1));
  218.   upstring:=temp_str;                      {return the correct value}
  219. end;                                       {end of the upstring function}
  220.  
  221. procedure video(cond:boolean);{--------------Turns on or off the display}
  222.  
  223. { This will turn the display on or off.  You can still write to the screen
  224.   but the text will not be seen until you set video(on).  I have set up two
  225.   constants for this procedure -- On=True, Off=false.  You can use these
  226.   constants instead of true/false. NOTE: Some turbo instuctions will auto-
  227.   matically set the video as on.  Some are ClrScr, TextMode, etc}
  228.  
  229. begin
  230.   repeat until port[$3da] and 8=8;          {wait for video sync}
  231.   if cond then
  232.     port[$3d8]:=mem[$40:$65] or 8           {restore display}
  233.   else
  234.     port[$3d8]:=$25;                        {turn off display by setting regs}
  235. end;                                        {end of video procedure}
  236.  
  237. function exist(filename:string_of_255){------tests if a file exists}
  238.                :boolean;
  239.  
  240. { This routine will check to see if a file exists or not.}
  241.  
  242. var
  243.   f_test:file;
  244.  
  245. begin
  246.   assign(f_test,filename);
  247.   {$I-}
  248.   reset(f_test);
  249.   {$I+}
  250.   exist:=(ioresult = 0);
  251.   close(f_test);
  252. end;                                        {End of function exist}
  253.  
  254. PROCEDURE TitleScreen;
  255. var
  256.   key:char;
  257. BEGIN
  258.   {This screen was done with the aid of the Screen Writer program}
  259.   {Date: 03-21-87}
  260.   TextColor(LightGray);
  261.   TextBackground(Black);
  262.   ClrScr;
  263.   gotoxy(19,1);
  264.   TextColor(White);
  265.   TextBackground(Cyan);
  266.   video(false);
  267.   Writeln('┌────────────────────────────────────────┐');
  268.   gotoxy(19,2);
  269.   TextColor(White);
  270.   TextBackground(Cyan);
  271.   Write('│');
  272.   TextColor(LightGray);
  273.   TextBackground(Blue);
  274.   Write(' ╔═══╕   ╔══╕  ╔══╗  ╔══╕  ╔══╕  ╔╗  ╥  ');
  275.   TextColor(White);
  276.   TextBackground(Cyan);
  277.   Writeln('│');
  278.   gotoxy(19,3);
  279.   TextColor(White);
  280.   TextBackground(Cyan);
  281.   Write('│');
  282.   TextColor(LightGray);
  283.   TextBackground(Blue);
  284.   Write(' ╚═══╗   ║     ║  ║  ║     ║     ║╚╗ ║  ');
  285.   TextColor(White);
  286.   TextBackground(Cyan);
  287.   Writeln('│');
  288.   gotoxy(19,4);
  289.   TextColor(White);
  290.   TextBackground(Cyan);
  291.   Write('│');
  292.   TextColor(LightGray);
  293.   TextBackground(Blue);
  294.   Write('     ║   ║     ╠═╦╝  ╠╡    ╠╡    ║ ╚╗║  ');
  295.   TextColor(White);
  296.   TextBackground(Cyan);
  297.   Writeln('│');
  298.   gotoxy(19,5);
  299.   TextColor(White);
  300.   TextBackground(Cyan);
  301.   Write('│');
  302.   TextColor(LightGray);
  303.   TextBackground(Blue);
  304.   Write(' ╘═══╝   ╚══╛  ╨ ╚╕  ╚══╛  ╚══╛  ╨  ╚╝  ');
  305.   TextColor(White);
  306.   TextBackground(Cyan);
  307.   Writeln('│');
  308.   gotoxy(19,6);
  309.   TextColor(White);
  310.   TextBackground(Cyan);
  311.   Write('│');
  312.   TextColor(LightGray);
  313.   TextBackground(Blue);
  314.   Write(' ╥   ╥   ╔══╗  ╒╦╕  ╒══╦══╕  ╔══╕  ╔══╗ ');
  315.   TextColor(White);
  316.   TextBackground(Cyan);
  317.   Write('│');
  318.   gotoxy(19,7);
  319.   TextColor(White);
  320.   TextBackground(Cyan);
  321.   Write('│');
  322.   TextColor(LightGray);
  323.   TextBackground(Blue);
  324.   Write(' ║   ║   ║  ║   ║      ║     ║     ║  ║ ');
  325.   TextColor(White);
  326.   TextBackground(Cyan);
  327.   Write('│');
  328.   gotoxy(19,8);
  329.   TextColor(White);
  330.   TextBackground(Cyan);
  331.   Write('│');
  332.   TextColor(LightGray);
  333.   TextBackground(Blue);
  334.   Write(' ║╔╧╗║   ╠═╦╝   ║      ║     ╠╡    ╠═╦╝ ');
  335.   TextColor(White);
  336.   TextBackground(Cyan);
  337.   Write('│');
  338.   gotoxy(19,9);
  339.   TextColor(White);
  340.   TextBackground(Cyan);
  341.   Write('│');
  342.   TextColor(LightGray);
  343.   TextBackground(Blue);
  344.   Write(' ╚╝ ╚╝   ╨ ╚╕  ╘╩╛    ─╨─    ╚══╛  ╨ ╚╕ ');
  345.   TextColor(White);
  346.   TextBackground(Cyan);
  347.   Write('│');
  348.   gotoxy(19,10);
  349.   TextColor(White);
  350.   TextBackground(Cyan);
  351.   Writeln('└────────────────────────────────────────┘');
  352.   TextColor(LightGray);
  353.   TextBackground(Black);
  354.   video(true);
  355.   gotoxy(25,12);
  356.   Write('E D I T O R   C O N F I G U R E');
  357.   gotoxy(1,15);
  358.   Writeln('':7,'The author wishes to note that this programme may be freely copied');
  359.   Writeln('':7,'and distributed as long as there are no costs imposed for the copy');
  360.   Writeln('':7,'other than prices for the media itself.  If anyone has any queries');
  361.   Writeln('':7,'he can reach me at:  Martine Wedlake');
  362.   Writeln('':28,'4551 N.E. Simpson St.');
  363.   Writeln('':28,'Portland, OR.');
  364.   Writeln('':28,'97218');
  365.   writeln;
  366.   Writeln('':21,'(C) Copywrite 1987, Martine B. Wedlake');
  367.   Writeln('':31,'<<< Press A Key >>>');
  368.   repeat until keypressed;
  369.   read(kbd,key);
  370. END;
  371.  
  372. procedure load_config;
  373. begin
  374.   if not exist('EDSCREEN.CNF') then
  375.   begin
  376.     with configure do
  377.     begin
  378.       graphic_letters[1,1]:=#205;
  379.       graphic_letters[1,2]:=#186;
  380.       graphic_letters[1,3]:=#187;
  381.       graphic_letters[1,4]:=#201;
  382.       graphic_letters[1,5]:=#188;
  383.       graphic_letters[1,6]:=#200;
  384.       graphic_letters[1,7]:=#206;
  385.       graphic_letters[1,8]:=#215;
  386.       graphic_letters[2,1]:=#196;
  387.       graphic_letters[2,2]:=#179;
  388.       graphic_letters[2,3]:=#191;
  389.       graphic_letters[2,4]:=#218;
  390.       graphic_letters[2,5]:=#217;
  391.       graphic_letters[2,6]:=#192;
  392.       graphic_letters[2,7]:=#197;
  393.       graphic_letters[2,8]:=#216;
  394.       graphic_letters[3,1]:=#180;
  395.       graphic_letters[3,2]:=#195;
  396.       graphic_letters[3,3]:=#194;
  397.       graphic_letters[3,4]:=#193;
  398.       graphic_letters[3,5]:=#185;
  399.       graphic_letters[3,6]:=#204;
  400.       graphic_letters[3,7]:=#203;
  401.       graphic_letters[3,8]:=#202;
  402.       graphic_letters[4,1]:=#184;
  403.       graphic_letters[4,2]:=#213;
  404.       graphic_letters[4,3]:=#190;
  405.       graphic_letters[4,4]:=#212;
  406.       graphic_letters[4,5]:=#183;
  407.       graphic_letters[4,6]:=#214;
  408.       graphic_letters[4,7]:=#189;
  409.       graphic_letters[4,8]:=#211;
  410.       graphic_letters[5,1]:=#181;
  411.       graphic_letters[5,2]:=#198;
  412.       graphic_letters[5,3]:=#208;
  413.       graphic_letters[5,4]:=#210;
  414.       graphic_letters[5,5]:=#182;
  415.       graphic_letters[5,6]:=#199;
  416.       graphic_letters[5,7]:=#207;
  417.       graphic_letters[5,8]:=#209;
  418.       graphic_letters[6,1]:=#219;
  419.       graphic_letters[6,2]:=#220;
  420.       graphic_letters[6,3]:=#221;
  421.       graphic_letters[6,4]:=#222;
  422.       graphic_letters[6,5]:=#223;
  423.       graphic_letters[6,6]:=#176;
  424.       graphic_letters[6,7]:=#177;
  425.       graphic_letters[6,8]:=#178;
  426.       graphic_letters[7,1]:=#142;
  427.       graphic_letters[7,2]:=#143;
  428.       graphic_letters[7,3]:=#146;
  429.       graphic_letters[7,4]:=#128;
  430.       graphic_letters[7,5]:=#144;
  431.       graphic_letters[7,6]:=#153;
  432.       graphic_letters[7,7]:=#154;
  433.       graphic_letters[7,8]:=#165;
  434.       graphic_letters[8,1]:=#131;
  435.       graphic_letters[8,2]:=#132;
  436.       graphic_letters[8,3]:=#133;
  437.       graphic_letters[8,4]:=#134;
  438.       graphic_letters[8,5]:=#145;
  439.       graphic_letters[8,6]:=#160;
  440.       graphic_letters[8,7]:=#166;
  441.       graphic_letters[8,8]:=#032;
  442.       graphic_letters[9,1]:=#130;
  443.       graphic_letters[9,2]:=#136;
  444.       graphic_letters[9,3]:=#137;
  445.       graphic_letters[9,4]:=#138;
  446.       graphic_letters[9,5]:=#139;
  447.       graphic_letters[9,6]:=#140;
  448.       graphic_letters[9,7]:=#141;
  449.       graphic_letters[9,8]:=#161;
  450.       graphic_letters[10,1]:=#147;
  451.       graphic_letters[10,2]:=#148;
  452.       graphic_letters[10,3]:=#149;
  453.       graphic_letters[10,4]:=#162;
  454.       graphic_letters[10,5]:=#167;
  455.       graphic_letters[10,6]:=#032;
  456.       graphic_letters[10,7]:=#032;
  457.       graphic_letters[10,8]:=#032;
  458.       graphic_letters[11,1]:=#129;
  459.       graphic_letters[11,2]:=#150;
  460.       graphic_letters[11,3]:=#151;
  461.       graphic_letters[11,4]:=#163;
  462.       graphic_letters[11,5]:=#032;
  463.       graphic_letters[11,6]:=#032;
  464.       graphic_letters[11,7]:=#032;
  465.       graphic_letters[11,8]:=#032;
  466.       graphic_letters[12,1]:=#135;
  467.       graphic_letters[12,2]:=#152;
  468.       graphic_letters[12,3]:=#164;
  469.       graphic_letters[12,4]:=#168;
  470.       graphic_letters[12,5]:=#159;
  471.       graphic_letters[12,6]:=#158;
  472.       graphic_letters[12,7]:=#157;
  473.       graphic_letters[12,8]:=#173;
  474.       graphic_letters[13,1]:=#155;
  475.       graphic_letters[13,2]:=#156;
  476.       graphic_letters[13,3]:=#171;
  477.       graphic_letters[13,4]:=#172;
  478.       graphic_letters[13,5]:=#174;
  479.       graphic_letters[13,6]:=#175;
  480.       graphic_letters[13,7]:=#169;
  481.       graphic_letters[13,8]:=#170;
  482.       graphic_letters[14,1]:=#226;
  483.       graphic_letters[14,2]:=#127;
  484.       graphic_letters[14,3]:=#233;
  485.       graphic_letters[14,4]:=#240;
  486.       graphic_letters[14,5]:=#228;
  487.       graphic_letters[14,6]:=#232;
  488.       graphic_letters[14,7]:=#234;
  489.       graphic_letters[14,8]:=#032;
  490.       graphic_letters[15,1]:=#224;
  491.       graphic_letters[15,2]:=#225;
  492.       graphic_letters[15,3]:=#227;
  493.       graphic_letters[15,4]:=#229;
  494.       graphic_letters[15,5]:=#230;
  495.       graphic_letters[15,6]:=#231;
  496.       graphic_letters[15,7]:=#233;
  497.       graphic_letters[15,8]:=#236;
  498.       graphic_letters[16,1]:=#237;
  499.       graphic_letters[16,2]:=#238;
  500.       graphic_letters[16,3]:=#239;
  501.       graphic_letters[16,4]:=#241;
  502.       graphic_letters[16,5]:=#242;
  503.       graphic_letters[16,6]:=#243;
  504.       graphic_letters[16,7]:=#244;
  505.       graphic_letters[16,8]:=#245;
  506.       graphic_letters[17,1]:=#246;
  507.       graphic_letters[17,2]:=#247;
  508.       graphic_letters[17,3]:=#248;
  509.       graphic_letters[17,4]:=#249;
  510.       graphic_letters[17,5]:=#250;
  511.       graphic_letters[17,6]:=#251;
  512.       graphic_letters[17,7]:=#252;
  513.       graphic_letters[17,8]:=#253;
  514.       graphic_letters[18,1]:=#003;
  515.       graphic_letters[18,2]:=#004;
  516.       graphic_letters[18,3]:=#005;
  517.       graphic_letters[18,4]:=#006;
  518.       graphic_letters[18,5]:=#024;
  519.       graphic_letters[18,6]:=#025;
  520.       graphic_letters[18,7]:=#026;
  521.       graphic_letters[18,8]:=#027;
  522.       graphic_letters[19,1]:=#001;
  523.       graphic_letters[19,2]:=#002;
  524.       graphic_letters[19,3]:=#016;
  525.       graphic_letters[19,4]:=#017;
  526.       graphic_letters[19,5]:=#018;
  527.       graphic_letters[19,6]:=#023;
  528.       graphic_letters[19,7]:=#019;
  529.       graphic_letters[19,8]:=#020;
  530.       help:=true;
  531.       insert_mode:=false;
  532.       forg:=lightgray;
  533.       back:=black;
  534.       help_path:='A:\';
  535.     end;
  536.   end
  537.    else
  538.   begin
  539.     assign(f_configure,'edscreen.cnf');
  540.     reset(f_configure);
  541.     read(f_configure,configure);
  542.     close(f_configure);
  543.   end;
  544. end;
  545.  
  546. procedure screen;
  547. begin
  548.   title(' SCREEN WRITER CONFIGURATION ');
  549.   textcolor(white);
  550.   gotoxy(1,6);
  551.   center('Written by Martine B. Wedlake');
  552.   textcolor(lightblue);
  553.   gotoxy(5,8);
  554.   write('Insert Mode At Start  :');
  555.   gotoxy(5,10);
  556.   write('Look To Disk For Help :');
  557.   gotoxy(5,12);
  558.   write('Path For Help         :');
  559.   gotoxy(5,14);
  560.   write('Forground At Start    :');
  561.   gotoxy(5,16);
  562.   write('Background At Start   :');
  563.   gotoxy(5,18);
  564.   write('The Graphic Letter Set:');
  565.   gotoxy(5,20);
  566.   write('Exit The Programme    :');
  567.   gotoxy(9,22);
  568.   textcolor(white);
  569.   write('Press [');
  570.   textcolor(white+blink);
  571.   write('+');
  572.   textcolor(white);
  573.   write('] to increase Graph Level, [');
  574.   textcolor(white+blink);
  575.   write('-');
  576.   textcolor(white);
  577.   write('] to decrease Graph Level.');
  578.   gotoxy(12,24);
  579.   center('Press <SPACE BAR> to reset.');
  580.   gotoxy(1,25);
  581.   center('Use arrow keys to position cursor.  Press RETURN to Activate');
  582. end;
  583.  
  584. procedure display_info(y,level,letter:integer);
  585. var
  586.   counter:integer;
  587. begin
  588.   textcolor(red);
  589.   gotoxy(30,8);
  590.   if configure.insert_mode then write('ON ') else write('OFF');
  591.   gotoxy(30,10);
  592.   if configure.help then write('YES') else write('NO ');
  593.   gotoxy(30,12);
  594.   clreol;
  595.   write(configure.Help_path);
  596.   gotoxy(30,14);
  597.   write(configure.forg:2);
  598.   gotoxy(30,16);
  599.   write(configure.back:2);
  600.   gotoxy(45,14);
  601.   textcolor(configure.forg);
  602.   textbackground(configure.back);
  603.   write('Colour');
  604.   textcolor(white);
  605.   textbackground(black);
  606.   gotoxy(45,16);
  607.   write('Graph Level: ',level:2);
  608.   gotoxy(30,18);
  609.   for counter:=1 to 8 do
  610.   begin
  611.     textcolor(white);
  612.     write(counter);
  613.     textcolor(red);
  614.     write(' ',configure.graphic_letters[level,counter],'   ');
  615.   end;
  616.   gotoxy(30,20);
  617.   write('':10);
  618.   if y<>18 then gotoxy(70,16);
  619.   clreol;
  620.   case y of
  621.     08:begin
  622.          gotoxy(30,8);
  623.          textcolor(black);
  624.          textbackground(white);
  625.          if configure.insert_mode then write('ON ') else write('OFF');
  626.          textcolor(white);
  627.          textbackground(black);
  628.        end;
  629.     10:begin
  630.          gotoxy(30,10);
  631.          textcolor(black);
  632.          textbackground(white);
  633.          if configure.help then write('YES') else write('NO');
  634.          textcolor(white);
  635.          textbackground(black);
  636.        end;
  637.     12:begin
  638.          gotoxy(30,12);
  639.          textcolor(black);
  640.          textbackground(white);
  641.          write(configure.Help_path);
  642.          textcolor(white);
  643.          textbackground(black);
  644.        end;
  645.     14:begin
  646.          gotoxy(30,14);
  647.          textcolor(black);
  648.          textbackground(white);
  649.          write(configure.forg:2);
  650.          textcolor(white);
  651.          textbackground(black);
  652.        end;
  653.     16:begin
  654.          gotoxy(30,16);
  655.          textcolor(black);
  656.          textbackground(white);
  657.          write(configure.back:2);
  658.          textcolor(white);
  659.          textbackground(black);
  660.        end;
  661.     18:begin
  662.          gotoxy(70,16);
  663.          textcolor(white);
  664.          write('ASCII = ');
  665.          clreol;
  666.          write(ord(configure.graphic_letters[level,letter]):3);
  667.          gotoxy(letter*6+26,18);
  668.          textbackground(white);
  669.          textcolor(blue);
  670.          write(configure.graphic_letters[level,letter]);
  671.          textcolor(white);
  672.          textbackground(black);
  673.        end;
  674.     20:begin
  675.          gotoxy(30,20);
  676.          textcolor(black);
  677.          textbackground(white);
  678.          write('':10);
  679.          textcolor(white);
  680.          textbackground(black);
  681.        end;
  682.   end;
  683. end;
  684.  
  685. procedure do_input;
  686. var
  687.   numstr:string[3];
  688.   letter,
  689.   level,
  690.   num,
  691.   y,
  692.   code:integer;
  693.   saved,
  694.   leave:boolean;
  695.   key,
  696.   key1:char;
  697. begin
  698.   leave:=false;
  699.   level:=1;
  700.   letter:=1;
  701.   y:=8;
  702.   repeat
  703.     repeat
  704.       key:=#0;
  705.       key1:=#0;
  706.       display_info(y,level,letter);
  707.       read(kbd,key);
  708.       if keypressed then read(kbd,key1);
  709.       case ord(key1) of
  710.         72:if y>8 then y:=y-2 else y:=20;
  711.         80:if y<20 then y:=y+2 else y:=8;
  712.         77:if (y=18) then
  713.              if letter<8 then letter:=letter+1 else letter:=1;
  714.         75:if (y=18) then
  715.              if letter>1 then letter:=letter-1 else letter:=8;
  716.       end;
  717.       if key='-' then if level>1 then level:=level-1 else level:=19;
  718.       if key in['=','+'] then if level<19 then level:=level+1 else level:=1;
  719.       if key=' ' then load_config;
  720.     until key=#13;
  721.     case y of
  722.      8:configure.insert_mode:=not configure.insert_mode;
  723.      10:configure.Help:=not configure.help;
  724.      12:begin
  725.           gotoxy(40,10);
  726.           write('Enter NEW Path for EdScreen.HLP');
  727.           gotoxy(30,12);
  728.           cursor(true);
  729.           repeat until keypressed;
  730.           clreol;
  731.           read(configure.help_path);
  732.           cursor(false);
  733.           gotoxy(40,10);
  734.           clreol;
  735.         end;
  736.      14:if configure.forg<15 then configure.forg:=configure.forg+1 else configure.forg:=0;
  737.      16:if configure.back<7 then configure.back:=configure.back+1 else configure.back:=0;
  738.      18:begin
  739.           gotoxy(20,17);
  740.           write('Enter ASCII for character to replace:');
  741.           repeat
  742.             cursor(true);
  743.             gotoxy(59,17);
  744.             clreol;
  745.             buflen:=3;
  746.             read(numstr);
  747.             cursor(false);
  748.             val(numstr,num,code);
  749.             if code<>0 then write(^g);
  750.           until code=0;
  751.           configure.graphic_letters[level,letter]:=chr(num);
  752.           gotoxy(20,17);
  753.           clreol;
  754.         end;
  755.      20:begin
  756.           gotoxy(30,20);
  757.           write('Do you want the Configuration saved [Y/N] ? ');
  758.           repeat
  759.             read(kbd,key);
  760.             key:=upcase(key);
  761.           until key in ['Y','N'];
  762.           leave:=true;
  763.           saved:=key = 'Y';
  764.         end;
  765.     end;
  766.   until leave;
  767.   if saved then
  768.   begin
  769.     assign(f_configure,'EDSCREEN.CNF');
  770.     rewrite(f_configure);
  771.     write(f_configure,configure);
  772.     close(f_configure);
  773.   end;
  774. end;
  775.  
  776. begin
  777.   cursor(false);
  778.   load_config;
  779.   TitleScreen;
  780.   Screen;
  781.   do_input;
  782.   cursor(true);
  783.   clrscr;
  784. end.