Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/13/19 in all areas

  1. This really should be fixed! Debugging this code structure will be more common as soon as 10.4 will fix inline declaration or when LSP will be released. procedure TTest.Test; begin if SomeCondition then begin var Qry := 'select * from sometable'; Check(Qry); // Breakpoint: S shows 'A' - Output in check = 'A' end; {..} if SomeOtherCondition then begin var Qry := 'select * from sometable where condition'; Check(Qry); // Breakpoint: S shows 'A' - should have been 'C' - Output in check = 'C' end; {..} while SomeCondition do begin var Qry := SomeFunction( SomeParameter ); Check(Qry); end; end; I'm not saying this construction is good or not, but if the new feature allows it, should work as advertised! Don't have much hair left to pull out.
  2. https://quality.embarcadero.com/browse/RSP-23056 Debugger watch / evaluate shows wrong values for inline declared local variables with duplicate names within same routine. Put a breakpoint on each of the lines with breakpoint in the comment. Run at A, hover over variable s, or evaluate s shows value A at C, hover over variable s, or evaluate s shows value A - should have been C The actual value is C - so it is a debugger bug program ReusedLocalVariables; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type TTest = class public procedure Check(const aValue: String); procedure Test; end; procedure TTest.Check(const aValue: String); begin Writeln(aValue); end; procedure TTest.Test; begin begin var s := 'A'; Check(s); // Breakpoint: S shows 'A' - Output in check = 'A' end; begin var s := 'C'; Check(s); // Breakpoint: S shows 'A' - should have been 'C' - Output in check = 'C' end; end; begin try var Test := TTest.Create; try Test.Test; Test.Free; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; finally Write('Press Enter: '); Readln; end; end.
  3. sjordi

    Put a control into the menu bar?

    Thanks a lot for your help Dave, Very useful. I'm going to dive into it right away 🙂
  4. luebbe

    GExperts 1.3.14 released

    When I install 1.3.14 into Delphi 10.3 Update 1, I receive the following error message when the IDE starts: --------------------------- bds.exe - Einsprungpunkt nicht gefunden --------------------------- Der Prozedureinsprungpunkt "@System@Classes@TFieldsCache@$bcctr$qqrv" wurde in der DLL "C:\Program Files (x86)\GExperts for RAD Studio 10.3\GExpertsRS103.dll" nicht gefunden. --------------------------- OK --------------------------- Sometimes the IDE continues and works, sometimes it becomes unresponsive and I have to kill it with task manager. Uninstalled 1.3.14, reinstalled 1.3.13 and everything is fine. Other installed plugins are: - FixInsight 1.1.1.6 - Compiler Speed Pack 6.4.1 - IDE Fix Pack 6.4.1 The same happens with 1.3.14 and Delphi 10.2. Update 3 Didn't copy the error message though. Plugins there: - FixInsight 1.1.1.5 - Compiler Speed Pack 6.3.1 - IDE Fix Pack 6.3.1
  5. Dave Nottage

    Put a control into the menu bar?

    I have a demo of how to do this on macOS, here: https://github.com/DelphiWorlds/KastriFree/tree/master/Demos/macOSStatusBar It relies on files in the Kastri Free project: https://github.com/DelphiWorlds/KastriFree For Windows, use a TTrayIcon. I think there's plenty of examples around the internet of how to use it.
  6. David Heffernan

    Rules for changing cursor to HourGlass and back

    Why would that be odd? That's pretty much a canonical use of try finally.
  7. Dave Nottage

    Rules for changing cursor to HourGlass and back

    Consider if DoSomeLongProcess causes an exception.. what will happen to the cursor if there was no try..finally? Consider also if the cursor was something other than the default before you changed it to an HourGlass? Should you restore it to default, or to what it was before you changed it?
  8. Dave Nottage

    Rules for changing cursor to HourGlass and back

    These days, I avoid changing the cursor at all, but provide feedback in other ways. If it's a long running process, it'll be performed in a background thread. If you really must change the cursor, be sure to save its current value, and wrap it all in a try..finally, e.g. SaveTheCurrentCursorAndChangeToHourGlass; try DoSomeLongProcess; finally RestoreCursorToWhatItWas; end;
×