Jump to content

Ian Branch

Members
  • Content Count

    1274
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Ian Branch


  1. Hi Team,

    I want to be able to make a generic function like this..

    function SetDBSessionNames(const ComponentCount: Integer; const Components: TComponent; const sSessionName: string): boolean;
    begin
      //
      for var i := 0 to ComponentCount - 1 do
      begin
        //
        if (Components[i] is TEDBSession) then (Components[i] as TEDBSession).SessionName := sSessionName;
        //
        if (Components[i] is TEDBDatabase) then (Components[i] as TEDBDatabase).SessionName := sSessionName;
        //
        if (Components[i] is TnlhTable) then (Components[i] as TnlhTable).SessionName := sSessionName;
        //
        if (Components[i] is TnlhQuery) then (Components[i] as TnlhQuery).SessionName := sSessionName;
        //
        if (Components[i] is TnlhScript) then (Components[i] as TnlhScript).SessionName := sSessionName;
        //
      end;
      //
    end;

    That would be called like this..

      //
      SetDBSessionNames(ComponentCount, Components, sSessionName);
    //

    The function is in a separate function library.

    Unfortunately it doesn't like  "Components" in the if.... lines. 😞

    I have obviously missed or misinterpreted some aspect.

    Some assistance/guidance would be appreciated.

     

    Regards & TIA,

    Ian 

     


  2. Hi Team,

    I have a TListview that currently looks like this.

    image.png.e07ac23b60eea751501fe4763c13988d.png

    I have tried to set the first column to Center justify but it keeps reverting to Left Justify. 😞

    What I would like is for the first column to be center justified, and the second colmn's header to be center but the rest of column to be right.

    I would also like the Header font to be Bold as well, but there doesn't appear to be any 'Font' related property.  😞

    Is this doable?

    If so, how please?

     

    Regards & TIA,

    Ian


  3. Yup.  Confirmed.  Remove  the comment on line 22 and the Formatter works on mine as well.

    In fact, if you have a comment on the end of any of the declarations, the Formatter fails.  Whether it is a '//' or a '{ }' style comment.

    A strange thing.

     

    Thomas, You want a bug report?

     

    [edit]  Bug Report submitted.  Oooops!  It went in as a feature request rather than a bug report. 😞  My Bad.

     

    Ian


  4. To all,

    Over the years I have used this Forum a lot.

    It has allways been a source of information.  Some great, enilightening, educating, some not so much. ;-)

    What has never failed, is to get an answer/help/advice when needed.

    I am a strong believer in the saying.. "There are no stupid questions, only stupid answers."

     

    So, to all of you who have helped and responded to User's questions, issues, etc.

    And in particular to those that have responed to my inane, sometimes ignorant, questions/issues.

    A very large THANK YOU!  THANK YOU!   THANK YOU!

    All very much appreciated.

     

    Regards,

    Ian

    P.S.  I'm sure I have many more questions/issues to come.  :-)

    • Like 7
×