Jump to content

Ian Branch

Members
  • Content Count

    1434
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Ian Branch


  1. 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


  2. 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


  3. 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


  4. 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;

     


  5. 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


  6. IndyIPServer290 issue:  Deleted it and the issue went away. 😉  It should have been deleted with the Clean up.

    LivePreview Issue:  Answered in 2021 when I had the same issue.  I don't use it so it doesn't matter.

     


  7. Hi Team,

    Win 11, D12.1.

    I installed the latest Indy10 per the instructions.

    I noted that the uninstall cmd kept failing due to access level.

    I manually deinstalled the indicated Indy files.

    I then installed the 290.groupproj without issue.

    On restarting D12 I see the following message:

    image.thumb.png.300bd23efbe2b3611fdfce1f6906451c.png

    I found IndyIPServer.dpk but Delphi doesn't like it.  😞

    Do I need this .bpl?

    If yes, how do I now recreate it to Indy10?

     

    I am also seeing this error when I start D12:

    image.thumb.png.44ec18798b60c9c954d5c47651201d55.png

     

    Regards & TIA,

    Ian

     

     

     


  8. So, the thicken plots....

    I have narrowed it down to using the ''' construct with the ExpandedText property of a TTaskDialog.

    I create the TTaskDialog in code.

    Everything is happy with this:

          ExpandedText := '1.	Wait - The App will try to reconnect until it connects or it has another connection timeout.' + sLineBreak
            + '2.	Cancel - This is a last resort selection and will result in an Application crash and generate a formal error report.' + sLineBreak
            + 'At this error prompt you have the normal error report options.' + sLineBreak +
            'If you don?t know or understand the error report dialog or the options available you should ask to your Workflow System Administrator.'
            + sLineBreak + 'It is strongly recommended that you select these options in the following priority/order => Wait then Cancel.';

    As soon as I put all the text into the ''' construct and double click on the OnShow property of the form, It gives me the error that it can't find OnShow.

    Interestingly, I didn't get the 'finally-end' inserted as I edited the text.


  9. Hi Brian,

    You may have hit on something there.

    I think I first noticed it when I was setting up text within the ''' - ''' multi-line structure.

    The 4 files I found the issue in had been so edited.

    I restored previous versions of each and all was fine.

    Today I was just editing one of those files in the IDE and was in the process of restructuring a block of text per the ''' multi-line structure, when it happened.  😞

    I had pressed enter at the end of the text line and got a 'finally-end' back.  😞

    I did a test again to see if double clicking on the OnShow Event would work, and no, it now failed per my original experience.

    I tried to back out the ''' construct, but the issue persisted.  😞

    I restored a 1 hour old backup and it was fine.

    Note to Self:  Don't bother with ''' constructs for the foreseeable future.

    This isn't a Patch 1 specific issue, 3 of the 4 files restored went 'faulty' around mid-Jan & the fourth around mid-Dec.

    Unfortunately, I can't replicate this in a test App.  😞

     

    Ian


  10. Hi Team,

    For what ever reason, it doesn't happen anymore.

    I didn't take notes, but I'm wondering if it was somehow related to the other issue I posted about which has been resolved.  Seemingly corruption of some sort that I couldn't identify.

    Unfortunately, I can't recall if I experienced this issue in those Projects specifically, or in others.  😞

    Certainly the issue reproduceable and annoying.

    Everything is working as expected now.

    Thank you all for your contributions.

    I will keep my fingers crossed...

     

    Regards,

    Ian

    • Like 1
×