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 1:18PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.