consider the following delphi pascal code:
var
tc: TComponent
begin
{ do something to get tc }
repeat
if(tc is TDBEdit)then begin
if(check_something_about_edit(tc))then break;
do_something_else_edit(tc);
break;
end else if(tc is TBMemo) then begin
if(check_something_about_memo(tc))then break;
do_something_else_memo(tc);
break;
end;
raise exception.create('invalid component type');
until(true); {single iteration look required to use break }
I know there's probably some polymorphic stuff that I could do with TComponent, but that's not my question. I'm wondering if there's a way to get rid of the single iteration repeat-until statement. Without it, I can't use the break statement anywhere in the processing block, and I need that to stop processing at any time.