misc/LETTERS.PAS

1.2 KB 255fced013da131e…
UNIT LETTERS;


INTERFACE

uses crt;

procedure cursor(state : boolean); {TRUE = ON}

PROCEDURE exit_text (writing : STRING;y_pos : integer);

IMPLEMENTATION

procedure cursor(state : boolean); {TRUE = ON}
begin
  case state of
    true : begin
      asm
        mov ah,01h
        mov ch,08h
        mov cl,08h
        int 10h
      end;
    end;
    false : begin
      asm
        mov ah,01h
        mov ch,28h
        mov cl,08h
        int 10h
      end;
    end;
  end;
end;


PROCEDURE exit_text (writing : STRING;y_pos : integer);
VAR  length_of_writing,i : INTEGER;

BEGIN
  TEXTCOLOR (0);
  length_of_writing := length (writing);
  FOR i := 1 TO length_of_writing DO BEGIN
    GOTOXY (i,y_pos);
    TEXTCOLOR (7);   WRITE (COPY(writing,i,1));
    TEXTCOLOR (15);  WRITE (COPY(writing,i+1,1));
    TEXTCOLOR (8);  WRITE (COPY(writing,i+2,1));
    TEXTCOLOR (7);   WRITE (COPY(writing,i+3,1));
    TEXTCOLOR (15);   WRITE (COPY(writing,i+4,1));
    TEXTCOLOR (8);   WRITE (COPY(writing,i+5,1));
    TEXTCOLOR (7);  WRITE (COPY(writing,i+6,1));
    TEXTCOLOR (15);   WRITE (COPY(writing,i+7,length_of_writing-i));
    DELAY (80);
    GOTOXY (1,y_pos);
  END;
  WRITELN;
END;

BEGIN
End.