-
Content Count
83 -
Joined
-
Last visited
Everything posted by uligerhardt
-
How to make "dynamic initialization" procedure
uligerhardt replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Seems like an array should be the way: type TMyFields = array[1..4] of TField; procedure TForm1.FormCreate(Sender: TObject); var LFields: TMyFields; i: Integer; begin for i := Low(TMyFields) to High(TMyFields) do LFields[i] := Query.FieldByName('FIELD' + IntToStr(i)); end; -
TForm Destroys are not called when target is macOS ARM 64-bit
uligerhardt replied to Navid Madani's topic in Cross-platform
Is this the cross-platform development I keep reading about? 😎 -
Surprising behavior of .ToUpper
uligerhardt replied to Hans♫'s topic in RTL and Delphi Object Pascal
Turkish has two kinds of I - one with dot and one without. Their case-handling is special. See Dotless I - Wikipedia. -
For me editting $DEFINEs and $IFDEFs sometimes breaks syntax highlighting - everything after the directive is colored like a preprocessor directive. (But I'm still on XE6)
-
If you don't want to change the order of parameters you can use two overloaded functions like this: interface function GetWeekDates(const GivenDate: TDateTime; const SOWDay: string; out startDate, endDate: TDateTime): Boolean; overload; function GetWeekDates(const GivenDate: TDateTime; out startDate, endDate: TDateTime): Boolean; overload; implementation function GetWeekDates(const GivenDate: TDateTime; const SOWDay: string; out startDate, endDate: TDateTime): Boolean; begin //... end; function GetWeekDates(const GivenDate: TDateTime; out startDate, endDate: TDateTime): Boolean; begin Result := GetWeekDates(GivenDate, 'SU', startDate, endDate); end; Alternatively, drop the overload and use different names like GetWeekDates and GetWeekDatesEx.
-
In our app we have some DXF related units whose names start with "Dx" or "DX". We also use DevEx and they have lower case "dx". So I'd like to have dx* case-sensitively grouped as third-party but left D* alone. Is there an option to make UsesCleaner do that?
-
UsesCleaner: Consider case for grouping?
uligerhardt replied to uligerhardt's topic in MMX Code Explorer
I see - thanks for the info, Uwe. And for all the useful tools. 🙂 -
Hi all, I recently started using UsesCleaner and mostly love it. One mildly annoying aspect is that it removes comments after units in the uses clause. I often have clauses like uses Unit1, // PALOFF - to suppress false positives from Pascal Analyzer Unit2, // used because of some obscure reason Unit3; // TODO remove when ... and have to reinstate all the comments after using UsesCleaner. Is there a way to make UsesCleaner leave the comments in place?
-
UsesCleaner: Retain comments in uses clause?
uligerhardt replied to uligerhardt's topic in MMX Code Explorer
Thanks for the info, Uwe - I already suspected this. Fortunately, it's not a big problem. -
Testers needed for GExperts Instant Grep expert
uligerhardt replied to dummzeuch's topic in GExperts
Next nitpick: If the Instant Grep window is focussed, pressing Shift-Alt-S brings up the Grep submenu. If I dismiss it (by clicking somewhere else) the expected Grep dialog shows. -
Testers needed for GExperts Instant Grep expert
uligerhardt replied to dummzeuch's topic in GExperts
MInor issue: Clicking the "Case sensitive" checkbox doesn't update the search. -
Works now for me. I loaded our historically grown monster project and it was parsed quickly and without obvious errors. 😉
-
After downloading the "official" version again, loading a DPR worked; creating the graph still doesn't - see PM.
-
Still can't load a project: I have XE6 and 10.4 installed.
-
I have the error when clicking on the folder icon without clicking Create. But I'll just try the new version. 🙂
-
Hi! I just downloaded and unpacked the RAR. When I start graph.exe and click on the Project icon I immediately get this: Any idea how to fix this?
-
Custom title bar (TTitleBarPanel) breaks form designer
uligerhardt replied to Gord P's topic in Delphi IDE and APIs
Never used TTitlebar but this sounds like there are related units left in the uses clause after removing the component. So maybe the problem hides in some initialization section? -
Migrate an old app in Delphi 2009 to modren C++
uligerhardt replied to Alkanium's topic in General Help
Do you know Delphi and/or C++? How big is the app? The first thing that should come to mind before considering a rewrite is "Never change a running system". -
Way for external app to jump to a unit and position inside the IDE?
uligerhardt replied to domus's topic in Delphi IDE and APIs
If you're prepared to write a wizard you might find something in this fragments from a very old wizard I no longer use: procedure TMyWizMainForm.ShowInMessageView(const FileName, MessageStr: string; LineNumber, ColumnNumber: Integer); var MessageServices: IOTAMessageServices40; begin MessageServices := BorlandIDEServices as IOTAMessageServices40; MessageServices.ClearCompilerMessages; MessageServices.ClearToolMessages; MessageServices.AddToolMessage(FileName, MessageStr, '.....', LineNumber, ColumnNumber); ShowMessageView; end; procedure TMyWizMainForm.ShowUnitSource(const FileName: string); begin (BorlandIDEServices as IOTAActionServices).OpenFile(FileName); end; procedure TMyWizMainForm.ShowParseError(e: EParseError); var EditorServices: IOTAEditorServices; TopView: IOTAEditView; EditActions: IOTAEditActions; begin ShowInMessageView(CurrUnit, e.Message, e.LineNo, e.ColumnNo); EditorServices := BorlandIDEServices as IOTAEditorServices; TopView := EditorServices.TopView; if TopView = nil then begin ShowUnitSource(CurrUnit); TopView := EditorServices.TopView; end; if TopView <> nil then begin EditActions := TopView as IOTAEditActions; EditActions.NextError; end; Close; Beep; end; It works (worked?) by inserting a custom line into the IDE's message window and make the IDE jump there. -
Way for external app to jump to a unit and position inside the IDE?
uligerhardt replied to domus's topic in Delphi IDE and APIs
You can use ShellExecute(0, 'open', PChar(FileName), nil, nil, SW_SHOWNORMAL); to show the unit in your registered Pascal editor - which probably is Delphi. I don't know about the line number. -
while TStream_TryRead() do
uligerhardt replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I think a repeat is conceptually the right thing here, as you want to read at least once unconditionally. And of course written like David did. 😉 -
while TStream_TryRead() do
uligerhardt replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Wouldn't a repeat-until loop do the trick? -
Lib for Getting process name that has the file open
uligerhardt replied to Tommi Prami's topic in Windows API
FWIW: There's also IFileIsInUse. E.g. delphi - Checking if the file is in use and by which application? - Stack Overflow. But it only works for apps that support it. -
Is there a Delphi equivalent of WriteStr ?
uligerhardt replied to Martin Liddle's topic in RTL and Delphi Object Pascal
That's the core of Uwe's code I linked to. -
Is there a Delphi equivalent of WriteStr ?
uligerhardt replied to Martin Liddle's topic in RTL and Delphi Object Pascal
Maybe something like this: Delphi-PRAXiS - Einzelnen Beitrag anzeigen - TextFile Writeln für Klasse verfügbar machen. (delphipraxis.net)