var cmdok: command;
id_t : integer;
begin
showform;
id_t:= formAddTextField('enter your name', '', 20, tf_any);
cmdok := createCommand('ok',cm_ok,1);
addcommand(cmdok);
repeat
delay (100);
until getclickedcommand <> emptycommand;
end.
Вот так всё норм работает