acces directly frxmemoview

I have this code, it works but it wanted to optimize it because it is not ideal
for i := 0 to sender.Objects.Count - 1 do begin
        loc_frxComp := tfrxcomponent(sender.Objects[i]);
        if (loc_frxComp is TfrxMemoView) and (copy( loc_frxcomp.name,1,8) = 'frxtalla')  
        then begin
           tfrxmemoview(loc_frxcomp).visible := false;                                                          
        end;
   end;

It wanted to acces to the object directly, I can do something like that
    for i:=0 to 15 do
    begin
         tfrwmemoview( 'frxtalla'+inttostr(i) ).visible := false;  //  This does not work
    end

thanks

Comments

  • gpigpi
    edited 5:50PM
    Use TfrxMemoView(frxReport1.FindObject('frxtalla'+inttostr(i))).Visible := False;
  • edited November 2011
    gpi wrote: »
    Use TfrxMemoView(frxReport1.FindObject('frxtalla'+inttostr(i))).Visible := False;

    It looks better but if you want speed optimization it is better first code.
    Depends on what do you want to optimize.

Leave a Comment