Well I'm sorry that didn't help, don't worry it wasn't much trouble anyway, but I'm on a linux machine, so no TP for me, but I think it should work the same.
I hit ^D twice also, not just once and I find it weird that it does not work for you.
But since you have restated the problem since, apparently it doesn't have to do with stdin anyway, you are asked to loop over a given array without a given legnth and the ending condition would be on a value.
I am just suspicous on the value being 'D' because it doesn't mean anything particularly interesting (while ^D was a natural ending for input)
Apparently it isn't too clear for your teacher either, so this problem could very well never end in diverging interpretations.
Here is an interpretation:
-> you read chars, and you translate them as (single digit) numbers until one of the chars is just 'D' (why not ?)
So this code would work as an example, but it's rather silly...
const n=5;
var values: array[1..n] of char = ('1', '3', '7', '8', 'D') ;
var i, total: integer;
var v:char;
begin
total:=0;
for i:=1 to n do
begin
v:=values;
if(v='D') then break;
total:=total+integer(v)-integer('0');
end;
writeln(total);
end.
note that I put a const length anyway so you might not like it, but the whole thing is silly anyway, you can loop with a while instead and don't mention the length anywhere (except when actually giving the array itself)...
Cheers...