procedure copy_block(copy:boolean);
label exit;
var i,l:integer;
begin
l:=block_end-block_begin+1;
if (l>0) and (text_length+l<TXTMAX) then
    begin
    if (block_begin>=index) then
        begin
        block_begin:=block_begin+l;
        block_end:=block_end+l;
        end
    else if block_end>=index then goto exit;
    for i:=text_length downto index do text[i+l]:=text[i];
    for i:=0 to l-1 do text[index+i]:=text[block_begin+i];
    text_length:=text_length+l;
    if copy then
        begin
        block_begin:=index;
        block_end:=block_begin+l-1;
        end
    else
        begin
        block_end:=index; index:=block_begin;
        delete_chars(l);
        index:=block_end; block_begin:=index; block_end:=block_begin+l-1;
    end;
    n_lines:=calc_tables(line(index));
    display_rest_page(page_top);
    end;
exit:
end; { copy_block }
