-
Content Count
402 -
Joined
-
Last visited
-
Days Won
8
Posts posted by Kryvich
-
-
Several years ago, I suggested adding the ability to call global functions and procedures as if they were class members of their first const parameter. For example, the standard function Trim could be used like this:
Result := ' ABCD '.Trim; // equals to Result := Trim(' ABCD ');
Unfortunately, they came up with the concept of non-extensible helpers.
-
Yes, I can now export my data to XML. The resulting XML looks similar to what I get with SimpleXML. I will test it further.
Thank you!
- 1
-
Very interesting library! I am used to use SimpleXML, but if your library is really that fast, I will definitely switch to it. SimpleXML supports ANSI encoding to reduce memory usage, but I think it will not be too difficult to add ANSI to Neslib.Xml.
Converting one of my program from SimpleXML to Neslib.Xml was not difficult, but I ran into an exception EIntOverflow in the procedure TXmlPointerMap.Map. Call stack is:
QuoteNeslib.Xml.Types.TXmlPointerMap.Map($406FDB,4765096,$19FDF8)
Neslib.Xml.Types.TXmlPointerMap.Map($B50FF0,0,$B51008)
Neslib.Xml.TXmlAttribute.SetNext(($B51008))
Neslib.Xml.TXmlNode.InternalAddAttribute(5,'4')
Neslib.Xml.TXmlNode.AddAttribute('check2','4')
ExportToXml.DoExportToXml($27E1AF0,TXmlDocument($27D3604) as IXmlDocument)
ExportToXml.ExportToXmlI was able to make a truncated test project to demonstrate the exception, please look at the attachment.
P.S. And thank you for the insightful article. I like this type of optimizations!
-
This "sugar" is too expensive.
-
-
@A.M. Hoornweg It depends on Windows ANSI codepage. I have CP-1251.
QuoteIt appears that the Widechar ordinal values are THE SAME as the Ansichar values
It appears that converting back to binarystring is SAFE
It appears that converting back to ANSIstring is UNSAFE
It appears that converting back to RAWBYTEstring is UNSAFEThe compiler also issues a lot of warnings:
Quote[dcc32 Warning] Ansistring28591.dpr(23): W1057 Implicit string cast from 'Binarystring' to 'string'
[dcc32 Warning] Ansistring28591.dpr(33): W1058 Implicit string cast with potential data loss from 'string' to 'Binarystring'
[dcc32 Warning] Ansistring28591.dpr(37): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'
[dcc32 Warning] Ansistring28591.dpr(38): W1057 Implicit string cast from 'Binarystring' to 'string'
[dcc32 Warning] Ansistring28591.dpr(38): W1057 Implicit string cast from 'AnsiString' to 'string'
[dcc32 Warning] Ansistring28591.dpr(41): W1058 Implicit string cast with potential data loss from 'string' to 'RawByteString' -
We need a real RawByteString without ANY implicit conversions. Just show a compiler error when trying to implicitly convert a string. Or improved TBytes with copy-on-write and all manipulation routines.
- 2
- 1
-
@A.M. Hoornweg Why duplicate what the standard library already does for strings, including byte manipulation and copy-on-write?
-
1) Recommendations can change over time. 2) Look at Microsoft: they used UTF-16 as the default string for Unicode Windows in the beginning, and now they trying to use UTF-8 instead.
-
I would use RawByteString in this case, despite the warning in the manual. (Actually, that's what I do in such cases.) I don't think these strings will be thrown out of the RTL in the future. Use raw byte strings inside the module, explicitly converting them to Unicode strings in the output.
- 2
-
Very impressive!
-
Try remove const in the header of function Login.
-
@WillH Actually the project is maintained 17 years by these people:
QuoteWe have our Bold source in a private repository and can contribute anytime. It has been in production for 17 years now. We make continuous bugfixes and optimizations in the source. Sometimes also new features. Currently, we are using Delphi 10.3 Rio but will soon switch to 10.4 Sydney.
Now they can legally open their changes to everyone.
- 2
-
-
I really hope for the release before 11/28/2020. Because after that date, my Community Edition will turn into a pumpkin.
-
@Carlo Barazzetta Thank you! Your components are a must-have for High-DPI enabled applications. I would say High-DPI is a second revolution in Delphi desktop development after Unicode.
- 1
-
-
35 minutes ago, Darian Miller said:There's always hope for 10.4.1!
Rather hope for 10.5. They are unlikely to break DCU compatibility in 10.4.1.
-
Well I would prefer the short form for other record operators too:
typeName = record operator conversionOp: resultType; operator unaryOp: resultType; operator comparisonOp(b: type): Boolean; operator binaryOp(b: type): resultType; end;
-
So how you like a syntax Embarcadero finally choose for initialization / finalization of the custom managed records?
type TMyRecord = record Value: Integer; class operator Initialize (out Dest: TMyRecord); class operator Finalize(var Dest: TMyRecord); class operator Assign (var Dest: TMyRecord; const [ref] Src: TMyRecord); end;
Early in 2018 Marco showed a slightly different syntax.
I personally would prefer something like
type TMyRecord = record Value: Integer; operator Initialize; operator Finalize; operator Assign(const [ref] Src: TMyRecord); end;
Then Dest would be replaced by Self.
-
It's unfair to compare the ancient Delphi 2007 with the relatively new VS 2017. It is not even Unicode compliant.
-
Rad Studio has the Migration tool. You can use it to backup & restore registry settings, to migrate to newer version of Delphi.
-
VCL Per Control Styling is planned for 10.4 (https://community.idera.com/developer-tools/b/blog/posts/get-ready-for-the-10-4-beta-with-update-subscription). Perhaps it will help to solve the problem.
-
Why not leave ParentFont property value to default, and modify font settings in Form.OnShow?
Simple inlined function question
in Algorithms, Data Structures and Class Design
Posted
@Mike Torrettinni What version of Delphi are you using and what compiler directives are set? I ran your test in Delphi 10.3 CE and I got the same assembler code for both cases.