Код:
program Project2;
{$APPTYPE CONSOLE}
Uses
SysUtils,windows;
Var
n,kolsimvolov,i,j,akey : Integer;
text,textkey,key : String;
Begin
SetConsoleOutputCP(1251);
Writeln ('введите количество символов в блоке');
Readln(n);
Writeln ('Введите ключ');
Readln(key);
Writeln ('Введите текст');
Readln (text);
kolsimvolov:=Length(text);
i:=0;
textkey:='';
Repeat
For j:=1 to n do
begin
akey:=Byte(key[j]);
If akey = 0 then Break;
If i + akey <= kolsimvolov then
textkey:=textkey + text[i + akey];
end;
i:=i + n;
Until (i>=kolsimvolov);
Writeln ('Зашифрованный текст: ');
Writeln (textkey);
Readln;
End.
помогите найти ошибку.не выводит зашифрованный текст