Patrick
(Patrick Lanz)
1
Hello,
What do you think about implementing a “while matching” loop?
For example, the following code:
while matching Item := NextItem do ...;
will compile to:
loop begin
var Item := NextItem;
if not assigned (Item) then
break;
...
end;
This can be very handy if we need to process elements until we receive a null value.
1 Like
mh
(marc hoffman)
2
Me like. potentially with an explicit type.
while matching Item: String := NextItem do ...;
would compile to:
loop begin
var Item := NextItem;
if not Item is String then
break;
...
end;
Thanks, logged as bugs://84802
Patrick
(Patrick Lanz)
4
I think it should be:
loop begin
var Item := String (NextItem);
if not assigned (Item) then
break;
...
end;
So to avoid a double casting
mh
(marc hoffman)
5
Sorry, yes. Item would be strongly typed ofc.