while stack[i]<> 'a ' do
begin
read(stack[i]);
....
....

end.

Above is part of my code. I wonder how can I exit the while loop by hitting the enter key instead of typing a ? is there any other method?

Please help, thanks