Archive for the ‘Event’ Category
Posted by jpluimers on 2018/04/05
For a very long time I’ve discouraged people from using non-ASCII characters in identifiers. It still holds.
In the past, transliterations messed things up. Even with increased support for Unicode, tools still screw non-ASCII characters up.
Delphi is not alone in this (the most important one is the DFM view as text support), see this report: [RSP-16767] Viewing a form as text fails with non ascii control or event names – Embarcadero Technologies (you need an account for this, but the report is visible for anyone):
Viewing a form as text fails with non ascii control or event names Comment
Steps:
- create a new VCL forms application
- drop a label onto the form
- change the name of that label to lblÜberfall (note the U-umlaut)
- switch to view as text
- exp: DFM content shown as text
- act: first line is shown incorrectly (see screenhsot)
–jeroen
Source: [RSP-16767] Viewing a form as text fails with non ascii control or event names – Embarcadero Technologies
via: [WayBack] Code of the day – – Thomas Mueller (dummzeuch) – Google+:
function TNameGenerator.StrasseToStrasse(const _Strasse: string): string;
begin
Result := _Strasse;
end;
…
Strasse := StrasseToStrasse(_Strasse);
Read the rest of this entry »
Posted in ASCII, Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Encoding, Event, Mojibake, Software Development | Leave a Comment »
Posted by jpluimers on 2018/02/01
One day I must re-publish these papers:

[WayBack] GetPublished – Author Information
From the referencing pages:
Intermediate paper for Delphi programmers starting to use Linux. It explains how to use and integrate Linux and Kylix with Windows and Delphi.�
As a Delphi developer, you will find C# easier to learn than you might have thought. Get a head start with this revealing presentation.�
This session describes COM, CORBA and SOAP, indicating what they share, what sets them apart, and how you can choose among them.�
This session provides a demonstration of ReCruit, including a discussion of its development and deployment process. ReCruit was built using Delphi and InterBase.�
–jeroen
Posted in BorCon, C#, Conferences, Delphi, Development, Event, SOAP/WebServices, Software Development | Leave a Comment »
Posted by jpluimers on 2018/01/31
Of the things not possible with generics in Delphi, I already wrote about Impossible: Property using Generics in Delphi.
Now it’s time to write about simulating a free function with generics as this is impossible:
function CreateManaged<T>(const value: T): IManaged<T>;
Usually I create a static record method for these, as records do not have VMT overhead, less RTTI overhead and I’ve been used to see records as helpers for other types long before helpers initially were introduced in Delphi 8 to extend classes..
Spring4D has an excellent example of such a record workaround in the Managed.New<T> commit:
type
Managed = record
public
class function New<T>(const value: T): IManaged<T>; static;
end;
...
class function Managed.New<T>(const value: T): IManaged<T>;
begin
Result := TManaged<T>.Create(value);
end;
It basically is a factory for classes implementing the IManaged interface.
In the mean time, Managed has been renamed to Shared but the above code shows my point.
–jeroen
Reference: [WayBack] Class Helpers documented in Delphi 2007, introduced in Delphi 8
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 5 Comments »
Posted by jpluimers on 2018/01/04
A few people recently discovered the beauty of record helpers:
Record helpers can help any value type (which includes enumerated types) so you can add functions to enumerations.
Class helpers can help class types.
There are no interface helpers and likely won’t be there for a long while.
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Power User, Software Development | 2 Comments »
Posted by jpluimers on 2017/12/27
It’s too bad that you need workarounds to get ByteStrings working on mobile devices as there are APIs there (like shaders) that work best with them.
There was a nice discussion on this last year at [WayBack] I miss AnsiString on Mobile…not only for Internet but for Shaders also.// FMX.Context.GLES.pasconstGLESHeaderHigh: array [0..24] of byte =(Byte(‘p), … – Paul TOTH – Google+ based in this code example in the FMX library undocumented unit FMX.Context.GLES:
// FMX.Context.GLES.pas
const
GLESHeaderHigh: array [0..24] of byte =
(Byte('p'), Byte('r'), Byte('e'), Byte('c'), Byte('i'), Byte('s'), Byte('i'), Byte('o'), Byte('n'), Byte(' '),
Byte('h'), Byte('i'), Byte('g'), Byte('h'), Byte('p'), Byte(' '), Byte(' '), Byte(' '), Byte('f'), Byte('l'),
Byte('o'), Byte('a'), Byte('t'), Byte(';'), Byte(#13));
There are more than 500 places in the Delphi library sources that uses this construct and even more that do other fiddling (like [WayBack] TEncoding.GetBytes) to get from strings to bytes.
I wonder if by now we still need the workarounds that Andreas Hausladen provides:
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Encoding, Event, Software Development | 6 Comments »
Posted by jpluimers on 2017/12/21
I started this post as “A case against FreeAndNil” but soon found out about [WayBack/Archive.is] A case against FreeAndNil – Community Blogs – Embarcadero Community.
Recently I was refactoring a bunch of code that was classed based to become interface based.
The old code had a lot of references to classes like this:
FMyField: TMyClass;
The compiler had detected those as compiler errors so now they were like this:
FMyField: IMyInterface;
But the compiler would still happily compile code (for instance in destructors) containing:
FreeAndNil(FMyField);
The only way that FreeAndNil can be implemented is with an untyped var parameter:
Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 14 Comments »
Posted by jpluimers on 2017/10/31
A few tricks to write long strings to files when the Delphi debugger cuts them off (just because they like using 4k buffers internally);
TStringStream.Create(lRequestMessage).SaveToFile('c:\temp\temp.txt')
TIniFile.Create('c:\a.txt').WriteString('a','a',BigStringVar)
TFileStream.Create('c:\a.txt', fmCreate or fmShareDenyNone).WriteBuffer(Pointer(TEncoding.UTF8.GetBytes(BigStringVar))^,Length(TEncoding.UTF8.GetBytes(BigStringVar)))
They all work form the debug inspector, but they do leak memory. See comments below.
Via:
–jeroen
Read the rest of this entry »
Posted in About, Conference Topics, Conferences, Delphi, Development, Encoding, Event, Software Development | 6 Comments »
Posted by jpluimers on 2017/10/24
I barely made it to EKON21 mainly because of extensive family members care-taking, so could not attend everything and archived the site for
The Conference for Delphi & More | 23 – 25 October 2017, Cologne | presented by Entwickler Akademie and Entwickler Magazin
[WayBack] EKON 21 – The Conference for Delphi & More:
It seems one older conference is archived.
–jeroen
Posted in Conferences, Delphi, Development, EKON, Event, Software Development | Leave a Comment »
Posted by jpluimers on 2017/09/25
At the end of April 2014, Roman Yankovsky started a nice [Wayback] discussion on Google+ trying to get upvotes for [Wayback] QualityCentral Report #: 124402: Compiler bug when comparing chars.
His report basically comes down to that when using Ansi character literals like #255, the compiler treats them as single-byte encoded characters in the current code page of your Windows context, translates them to Unicode, then processes them.
The QC report has been dismissed as “Test Case Error” (within 15 minutes of stating “need more info”) by one of the compiler engineers, directing to the [Wayback] UsingCharacterLiterals section of Delphi in a Unicode World Part III: Unicodifying Your Code where – heaven forbid – they suggest to replace #128 with the Euro-Sign literal.
I disagree, as the issue happens without any hint or warning whatsoever, and causes code that compiles fine in Delphi <= 2007 to fail in subtle ways on Delphi >= 2009.
The compiler should issue a hint or warning when you potentially can screw up. It doesn’t. Not here.
Quite a few knowledgeable Delphi people got involved in the discussion:
Read the rest of this entry »
Posted in Ansi, ASCII, Conference Topics, Conferences, CP437/OEM 437/PC-8, Delphi, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Encoding, Event, ISO-8859, Missed Schedule, QC, SocialMedia, Software Development, Unicode, UTF-8, Windows-1252, WordPress | Leave a Comment »