Refal's solution is definitely the most efficient, but I thought that I would explain why your code didn't work.
You wrote:
do i = 1 to fanlage:num-items :
fAnlage:delete(i).
end.
And there's a couple of things wrong.
Firstly, the NUM-ITEMS attribute will be evaluated on each iteration of the loop. Which means that the value changes each time. So because variable i is increasing and NUM-ITEMS is decreasing, the loops ends too soon.
Secondly, the method call fAnlage:delete(i) should read fAnlage:delete(1)because the index of the remaining items is changing at each iteration. So entry 2 becomes entry 1 when entry 1 is deleted, and so on.
To make your code work correctly, it would have to look like this:
j = fanlage:num-items.
do i = 1 to j :
fAnlage:delete(1).
end.
But this would work just as well:
do while fanlage:num-items > 0:
fAnlage:delete(1).
end.
But as I've said, stick with Rafal's solution.