Archive for the ‘Delphi’ Category
Posted by jpluimers on 2018/07/12
It seems I forgot to schedule this post, as it was still in the drafts.. So here it is for historic purposes. Likely a few links have died by now.
Last year I could not make it to CodeRage 8 as I was prepping for EKON 17 and ITDevCon 2013.
But there were some nice presentations, some of which I really wanted to see again.
So I was glad to have found the CodeRage 8 Replays: http://www.youtube.com/playlist?list=PLwUPJvR9mZHiaYvH9Xr7WuFCVYugC4d0w.
Especially for these sessions as REST support is an under-marketed aspect of Delphi XE5:
And a few others as well:
- Oct 16, 1pm – Responsive Delphi Design – YouTube.
- Oct 16, 11am – Deep Dive Into Creating Android Apps – YouTube.
- Oct 15, 1pm – Beyond The App – YouTube.
- Oct 15, 2pm – Devices and Sensors in IOS and Android – YouTube.
- Oct 16, 8am – From Idea to Submitted Mobile App in 30 Minutes – YouTube.
- Oct 15, 8am – CodeRage 8 Delphi – A VCL Developers Guide To FireMonkey – YouTube.
- Oct 15, 10am – Designing Common User Interfaces for iOS & Android – YouTube.
- Oct 15, 5pm – Real Mobile Implementation Patterns – YouTube.
- Oct 15, 11am – LiveBindings and Rapid Prototyping – YouTube.
- Oct 17, 9am – Secure Database Storage for Mobile and Desktop – YouTube.
- Oct 17, 11am – Introducing TMS Aurelius, a Delphi ORM – YouTube.
- Oct 17, 2pm – Caching Updates with FireDAC – YouTube.
- Oct 15, 12pm – Introduction to iOS and Android Devices connecting to a DataSnap Server – YouTube.
- Oct 16, 6am – DataSnap Architectures, Optimizations, and Use Cases – YouTube.
- Oct 16, 7am – Secure DataSnap Development – YouTube.
- Oct 15, 3pm – Common Delphi Coding Anti-Patterns – YouTube.
- Oct 17, 5pm – Developing Windows & Android Apps with Mitov Software Component Libraries – YouTube.
–jeroen
Posted in Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2018/07/12
Just as a reminder to self: the non-generic TStringList and TList grow way less aggressive than the generic TList:
- TList.Grow and TStringList.Grow:
- 4, 8, 12, 28, 44, 60, 76, 95, 118, 147, 183, 228, 285, 356, 445, 556, 695, 868, 1085
- Generic TList growth via TListHelper.InternalGrow:
- 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
Sources:
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2018/07/11
[WayBack] QualityCentral 110308 – TDBEdit updates wrongly Datalink.Modified when Dataset being in Browse mode and [WayBack] QualityCentral 127300 – Closed Exception When Ctrl+A (select text) on TDBEdit have been partially fixed in Delphi 10.2 Tokyo under [RSP-16288] Bug after selecting all the text by pressing Ctrl+A in TDBEdit and pressing TAB – Embarcadero Technologies.
Since there is only manual syncing from Quality Portal to Quality Central, and only Quality Central is indexed by search engines, the public at large usually finds the Quality Central bugs.
Basically, the affected controls ([WayBack] TDBEdit, [WayBack] TDBComboBox, [WayBack] TDBMemo, but not [WayBack] TDBRichEdit – probably not needed as I could not reproduce the [WayBack] TClientDataSet based QC127300 attachment in Delphi 10.1 with TDBMemo or TDBRichEdit, though neither selected of these two all text, which 10.2 also fixes).
the .KeyPress methods now check for a Ctrl-A case like this:
^A:
begin
SelectAll;
Key := #0;
end;
and some of the .KeyDown methods have been tuned a little by setting Key := 0 when Edit returns false.
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2018/07/11

When accessing the VCL from multiple threads at the same time: adopted from …\DEMOS\THREADS\THRDDEMO.DPR
Great question a while ago:
[WayBack] “Don’t access VCL from a background thread” – how to demo that? – Primož Gabrijelčič – Google+
For me, the ultimate way why not to access the VCL from a background thread is the precursor of the official threads demo that ships from Delphi 2 to Delphi XE6 in ...DEMOS\THREADS\THRDDEMO.DPR. where you’d think the thread isolation would be in ...DEMOS\THREADS\ThSort.pas but actually is in ...DEMOS\THREADS\SortThds.pas.
The first public showing of that demo did not include main thread protection. It originates from a session at the the 1995 Borland Developers Conference where Ray Konopka showed the below code from Bob Ainsbury.
That session reminded why this joke [WayBack] Via the EKON20 sessions… – Jeroen Wiert Pluimers – Google+ was so funny: “When Ray Konopka enters the room you have a Raize condition.“.
The question above also made me find back this reference to BorCon95 in San Diego:
Read the rest of this entry »
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 10.2 Tokyo (Godzilla), Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »
Posted by jpluimers on 2018/07/05
Paul TOTH figured this out:
you can use any Linux API but it’s not trivial.
- you have to install the “dev” library under Llinux, like “apt-get install xxx-dev” for the xxx API
- you have to update the Linux DSK in Delphi
- you can declare the API as externals function as usual
- now you can compile and deploy the application.
If you miss the steps 1 or 2 you’ll have a linker error.
Source: [WayBack] Dear… Delphi 10.2 Tokyo, can i use linux api directly? like ‘fcntl(….)’.
And there is this great blog post that I found later by [WayBack] Allen Drennan: [WayBack] Importing third-party Linux libraries on Delphi 10.2 Tokyo – grijjy blog
–jeroen
Posted in Delphi, Delphi 10.2 Tokyo (Godzilla), Development, Software Development | Leave a Comment »
Posted by jpluimers on 2018/07/05
While updating some old code fiddling with the[WayBack] GetThreadId function, I wanted to have some TThread wrapper around it. I had totally forgotten there has been already a means for this since Delphi 2009 (which initially had a bug, but that was worked around at first and fixed later): [WayBack] CurrentThread.
The latest version of Delphi, Delphi 2009, has a CurrentThread class property on the TThread class.
This will return the proper Delphi thread object if it’s a native thread. If the thread is an “alien” thread, i.e. created using some other mechanism or on a callback from a third party thread, then it will create a wrapper thread around the thread handle.
20081001 at 5:00 – [WayBack] Barry Kelly
Sources
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 10.2 Tokyo (Godzilla), Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, QC, Software Development | Leave a Comment »
Posted by jpluimers on 2018/07/04
via [WayBack] Is it possible to range an arrays in Watches view to specific index range? Sometimes I work with arrays that contain 100Ks lines, and Watches limit the view to index 131071… – Mike Torrettinni – Google+
Reminder to check how well this works:
Given FInts: array of integer;
you can declare `TIntArray = array of integer;`
(I’m sure it exists somewhere already but couldn’t find it at the moment) and then watch, for example
TIntArray(@FInts[150000])
–jeroen
PS: Uwe Raabe commented on G+:
Uwe Raabe+1
You can add a watch variable like arr[4711] and set the
repeat count to a sensible value. Unfortunately this will give you a single line display which is not expandable.
https://quality.embarcadero.com/browse/RSP-19468
“Allow expanding watch variable with repeat count > 1”
Posted in Delphi, Development, Software Development | 1 Comment »
Posted by jpluimers on 2018/07/03
ModelMaker Code Explorer does not allow you to edit the “most recently used” items in that you can use in various places, but luckily these history lists are all in the registry as keys under this base key:
HKEY_CURRENT_USER\Software\ModelMaker\MideX\#.0\Histories
There # is the major version number of ModelMaker Code Explorer (internally named MideX).
Under the base key, you can find these keys:
ExternalSpac not figured out yet
InterfaceSupport not figured out yet
Object PascalParameters list limited to 60 individual parameters (“Modifier Name: Type = Default”)
Parameters list limited to 60 parameter lists in the “Edit Method” wizard.
PascalTypeNames list limited to 60 variable types
PascalVarLookup list limited to 60 variables (each of form “Variable: Type”) used in the “Add Explaining Variable” wizard.
PropArray array indexes used in the property editor
PropDefaultSpec default values of properties in the property editor
PropWriteParam write parameters in the property editor
RenameLocal not figured out yet
ResStrExternalFile not figured out yet
Surrounds not figured out yet
UsedUnits list limited to 30 entries of the uses list editor
If you made a typo anywhere, then just edit or delete these entries.
–jeroen
Posted in Delphi, Development, ModelMaker Code Explorer, Software Development | Leave a Comment »
Posted by jpluimers on 2018/07/03
–
It’s important to describe features right so everyone understands what you mean.
And note that you should end all your IFDEF with IFEND to stay compatible with the broadest set of Delphi versions possible.
–jeroen
Source: [WayBack] delphi – What is the use of NEXTGEN compiler conditional? – Stack Overflow
PS: Note the comment below by Remy Lebeau:
Note, in Delphi XE3 and later, you might also need to use {$LEGACYIFEND ON} (http://docwiki.embarcadero.com/RADStudio/en/Legacy_IFEND_(Delphi)) in order to use {$IFEND} correctly, particularly if you have nested {$IF} and {$IF(N)DEF} blocks in your code.
A quick search for “LEGACYIFEND” “Delphi” “XE3” revealed this directive was indeed introduced in Delphi XE3, but not documented until XE4:
Brian Long documents how to get around the limitation that Remy commented about:
{$ifdef CONDITIONALEXPRESSIONS}
{$if CompilerVersion >= 24.0}
{$LEGACYIFEND ON}
{$ifend}
{$endif}
It is in fact at the top of [WayBack] indy/IdCompilerDefines.inc at master · graemeg/indy · GitHub, which reminds me that there is now a git mirror of Indy at GitHub:
[WayBack] GitHub – graemeg/indy: Indy (Internet Direct) framework. This is an unofficial mirror repository which gets synced every 15 minutes. It contains the full history from the official Indy 10 SVN repository.
–jeroen
Posted in Delphi, Development, Software Development | 2 Comments »