-
Content Count
443 -
Joined
-
Last visited
-
Days Won
8
Kryvich last won the day on September 29 2019
Kryvich had the most liked content!
Community Reputation
186 ExcellentTechnical Information
-
Delphi-Version
Delphi Community Edition
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Several json libraries tested
Kryvich replied to david berneda's topic in RTL and Delphi Object Pascal
HTML Component Library has now Fast and low memory JSON parser. 7x faster and 6x less memory compared to default. Although it is not free and not open source. -
New Delphi features in Delphi 13
Kryvich replied to David Heffernan's topic in RTL and Delphi Object Pascal
Last time I tried it, it tried to install its root certificate into Windows. -
A Conditional Ternary Operator for the Delphi
Kryvich replied to EugeneK's topic in RTL and Delphi Object Pascal
Great! This is a very long awaited addition for me. I hope they also add a case statement for string types -
Int, Frac functions and NaN value
Kryvich replied to Kryvich's topic in RTL and Delphi Object Pascal
@David Heffernan This is evident not only in the debugger, but also at runtime. That's the question. Processor - AMD Ryzen 5 3600. @DelphiUdIT That's good! I have the community edition, its version is 29.0.51961.7529, Delphi 12 Update 1. -
Something went wrong with system functions Int and Frac in Delphi 12, Win32 platform. At runtime, the result of the expression Frac(1.9) can be either 0.9 (as expected) or 0 or 0.89. I couldn't determine what affects this. Interestingly, in the Evaluate/Modify window, the expressions Frac(1.9) and Int(1.9) always return -NAN, whatever that means. Has anyone encountered these issues? As a temporary workaround, I used x-Trunc(x) instead of Frac(x).
-
Kryvich's Delphi Reporter - Simple reporting tool with templates in RTF, Word XML, Excel XML, HTML, plain text formats. For basic reports without images, charts, with a simple structure.
-
Change of column widths of ListField in TDBLookupComboBox
Kryvich replied to Squall_FF8's topic in VCL
@Squall_FF8 DataModule.LookupDatasetField1.DisplayWidth := 10; DataModule.LookupDatasetField2.DisplayWidth := 20; DataModule.LookupDatasetField3.DisplayWidth := 30; -
Change of column widths of ListField in TDBLookupComboBox
Kryvich replied to Squall_FF8's topic in VCL
You need to set the DisplayWidth property for the list fields of the list lookup dataset. AFAIK no. -
Tool for finding non-literal format strings
Kryvich replied to David Heffernan's topic in General Help
Definitely. But time is money. If Copilot can do it for you - why not? for Line in Lines do --> Line := Lines.Text; -
Tool for finding non-literal format strings
Kryvich replied to David Heffernan's topic in General Help
Copilot. The result: program FormatStringExtractor; uses SysUtils, Classes; function ContainsPlusBeforeComma(const S: string): Boolean; var PlusPos, CommaPos: Integer; begin PlusPos := Pos('+', S); CommaPos := Pos(',', S); Result := (PlusPos > 0) and (CommaPos > PlusPos); end; procedure ProcessFile(const FileName: string; LogFile: TStrings); var Lines: TStringList; Line, SubStr: string; StartPos, EndPos: Integer; begin Lines := TStringList.Create; try Lines.LoadFromFile(FileName); for Line in Lines do begin StartPos := Pos('Format(', Line); while StartPos > 0 do begin EndPos := PosEx('])', Line, StartPos); if EndPos > 0 then begin SubStr := Copy(Line, StartPos, EndPos - StartPos + 2); if ContainsPlusBeforeComma(SubStr) then LogFile.Add(SubStr); // Move the start position forward to find the next occurrence StartPos := PosEx('Format(', Line, EndPos + 2); end else Break; end; end; finally Lines.Free; end; end; procedure ProcessFolder(const Folder: string; LogFile: TStrings); var SearchRec: TSearchRec; FullPath: string; begin if FindFirst(Folder + '\*.*', faAnyFile, SearchRec) = 0 then begin repeat FullPath := Folder + '\' + SearchRec.Name; if (SearchRec.Attr and faDirectory) = faDirectory then begin if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then ProcessFolder(FullPath, LogFile); end else if ExtractFileExt(SearchRec.Name).ToLower = '.pas' then begin ProcessFile(FullPath, LogFile); end; until FindNext(SearchRec) <> 0; FindClose(SearchRec); end; end; var Folder: string; LogFile: TStringList; begin Write('Enter folder path to scan: '); ReadLn(Folder); LogFile := TStringList.Create; try ProcessFolder(Folder, LogFile); LogFile.SaveToFile('format.log'); WriteLn('Strings saved to format.log'); finally LogFile.Free; end; end. -
Can you please elaborate this? Maybe a short article on this topic. P.S. I've noticed that there have been several interesting Delphi projects from Brazilian developers lately. Skia for Delphi, D2Bridge Framework are the most notable.
-
Multiline strings '''...''' were a very nice addition to the language. Still waiting for constructions like case string1 of 'aaa':... DoubleValue := Variant1 if not VarIsNull(Variant1) else 0.0;
-
There are three things you can watch forever: fire, water, and code improving. procedure TLinkMemo.CNCommand(var Message: TWMCommand); begin inherited; case Message.NotifyCode of EN_VSCROLL: SyncLink(True); EN_HSCROLL: SyncLink(False); end; end; procedure TLinkMemo.SyncLink(Vertical: Boolean); const BAR_FLAGS: array[Boolean] of Integer = (SB_HORZ, SB_VERT); MSGS: array[Boolean] of Cardinal = (WM_HSCROLL, WM_VSCROLL); var scrollInfo: TScrollInfo; begin if LinkedMemo = nil then Exit; var savedLink := LinkedMemo.LinkedMemo; try LinkedMemo.LinkedMemo := nil; scrollInfo.cbSize := SizeOf(scrollInfo); scrollInfo.fMask := SIF_POS; if GetScrollInfo(Handle, BAR_FLAGS[Vertical], scrollInfo) then LinkedMemo.Perform(MSGS[Vertical], MAKEWPARAM(SB_THUMBPOSITION, scrollInfo.nPos), 0); finally LinkedMemo.LinkedMemo := savedLink; end; end; procedure TLinkMemo.WMHScroll(var Message: TMessage); begin inherited; SyncLink(False); end; procedure TLinkMemo.WMVScroll(var Message: TMessage); begin inherited; SyncLink(True); end;
- 39 replies
-
- delphi xe7
- synchronize
-
(and 2 more)
Tagged with:
-
Delphi TOIOBE index lifted in May 2022?
Kryvich replied to wuwuxin's topic in RTL and Delphi Object Pascal
1. Python -- First appeared 20 February 1991; 34 years ago 2. C++ -- First appeared 1985; 40 years ago 3. Java -- First appeared May 23, 1995; 29 years ago 4. С -- First appeared 1972; 53 years ago ... 10. Delphi -- Initial release 1995 Attention! Dinosaurs have won prizes! -
@limelect How do you scroll horizontally? I know some programs allow this by holding the shift key down while you operate the scroll wheel. But in our case it doesn't work. I can scroll horizontally by dragging the bottom slider on the scroll bar, or by moving the cursor to the end of the line with the keys.
- 39 replies
-
- delphi xe7
- synchronize
-
(and 2 more)
Tagged with: