Jump to content

Ian Branch

Members
  • Content Count

    1272
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Ian Branch


  1. Hi Team,

    I recently had the experience where all of my '.dproj' files in a major project group were corrupted.  😞

    So, I have had to rebuild them.  Oh, the pain!

    Anyway, MMX onfiguration is of course part of that.

    Having set a few 'Groups' in the 'Uses Clause Sorting' i tried setting the 'Default'.  Much to my pleasure, as I opened MMX for each of the 'new' projects, the Default and the Groups were set.  Halleluah!!

    Now, from time to time I extend the listing.  I tested and found that if I added to the 'Default', it didn't propagate to the 'Groups'. 😞

    It would be nice to have, say a checkbox, that made the Default used instead of Groups.

    If I guess correctly, if I change 'Default' then it would be used in all the Projects??

    Just a thought..

     

    Regards,

    Ian

     


  2. Thank you to all for your input so far.  Appreciated.

    The fact that I can create a New project and it works fine suggests that the functionality itself is still there and working.

    I opened a project that I hadn't touched for months, it worked fine....

    Which suggests something related to ALL my current projects.

    I tried adding a new form to a current project and testing, same result. 😞

     


  3. 16 minutes ago, Die Holländer said:

    When I switch in the editor from that source/unit tab to another source and back it  works and

    the editor will gray-out the proper sourcecode.

    Nope.  Didn't work.

    The IDE knows about the {.$DEFINE  XXXXX} because further down code that was enabled by the Define shows as an error in the Structure.

    At run time all is as it should be.

     

    I have also noticed Conditionals from the Project aren't being handled correctly at Design time either.  😞


  4. Hi Team,

    Win 11, D12.1.

    They used to, but I have just noticed that if I disable a DEFINE, {.DEFINE XXXXX}, the code between the {$IFDEF XXXXX} & {$ENDIF} no longer greys out the code inbetween.

    It used to.

    If I create a new project and do that, it works.

    Is there somewhere in my projects that I may have inadvertantly switched off that would cause this?

    This is an actual example where the code isn't being greyed out:

    image.png.802b0de556998523290da7ba0ffafd6e.png

    Regards & TIA,

    Ian


  5. Hi Team,

    Having installed D12.1 over D12, it of course installed its own Indy version.

    I am sure I saw/read somewhere about a a script of some sort that replaced the distributed with Delphi version with the one from GitHub.

    Hopefully I wasn't imagining it.

    Does this ring a bell with anyone?

     

    Regards & TIA,

    Ian


  6. Hi Team,

    This is as much to reinforce with me as it is info that may help others.

     

    "Local variables are actually not initialized, but global variables and object fields are initialized to zero (which means 'false' for boolean variables).

    Therefore you always have to initialize local variables yourself, compiler even generates a warning if you don't."

     

    I got caught out with an inline variable.  var lTest: boolean;

    I incorrectly assumed ite defaulted to False.

    This is not so, in fact in my tests it seems to default to TRUE.

    However, I won't bank on that and will allways initialise local variables now. 

    No, I never noticed the warning, or if I did I ignored it.  😞

     

    Ian


  7. 12 hours ago, dummzeuch said:

    Edit: There is System.ReturnAddress, introduced with Delphi XE2, which gives you just that, so

    Tks.  Exactly what I needed/wanted.

    I made a minor change as I am using D12:

    /// <summary>
    /// Retrieves the current line number.
    /// </summary>
    /// <remarks>
    /// Requires the JCLDebug unit.
    /// </remarks>
    /// <returns>The line number of the current position.</returns>
    function GetCurrentLineNumber: Integer;
    begin
      //
      var ModInfo := GetLocationInfo(ReturnAddress);
      //
      Result := ModInfo.LineNumber;
      //
    end;

    LineByLevel - Whilst I could use it in my code by adding JCLDebug, I wanted to have it as a function in my library.  If I used it from my library I got the line number in the library, not the Apps code.

     

    Regards & Tks again,

    Ian


  8. 1 hour ago, Der schöne Günther said:

    In case (for whatever reason), you really just like to add the current line number into a string, then have a look at:

    https://stackoverflow.com/q/7214213

    I had a look at that previously.  I may be missreading its use but it seems that JCLDebug relies on an Exception for something like this to work:

    function GetCurrentLineNumber: Integer;
    var
      ModInfo: TJclLocationInfo;
    begin
      ModInfo := GetLocationInfo(ExceptAddr);
    
      Result := ModInfo.LineNumber;
    end;

     


  9. Hi Team,

    Delphi 12.

    Is there a way to embed the current design time code line number into a string so that it can be shown in a message.  It needs to reflectthe actual line number, even if the previous code is edited and it's actual number changes.

    Regards & TIA,

    Ian

×