Archive for the ‘Delphi’ Category
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 »
Posted by jpluimers on 2018/06/29
Delphi formatter setting, so I can manually arrange uses lists:

–jeroen
Uwe Raabe commented on G+:
Also available in MMX Code Explorer in the settings dialog: Pascal -Sorting – Format unit uses clauses – “Each unit on a new line”.
If you prefer the standard setting and spare the other for special purpose, there is “Format Uses – Alternate” in the context menu. Perhaps give it a decent shortcut for quick access.
Bernd Ott in the same thread:
Important because scm. Less merge trouble. Only the last semicolon in last row is always stupid.
https://plus.google.com/+JeroenPluimers/posts/RfrCkDAd95G
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 4 Comments »
Posted by jpluimers on 2018/06/29
I forgot to schedule the post below. It is still relevant if you create a machine with lots of Delphi versions on it.
Read the rest of this entry »
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, Database Development, Delphi, Delphi 2007, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Firebird, InterBase, Power User, Software Development, Windows, Windows 8 | 2 Comments »
Posted by jpluimers on 2018/06/27
By default, Delphi always generates .res resource files when compiling a project.
There are two things you need to change to turn this off; the first is on by default, the second could be your own change:
- Remove the
{$R *.res} from your .dpr file and turn “Runtime Themes” to “None” from the default “Enable runtime themes” under “Target” settings “All configurations – 32-bit Windows platform” and “All configurations – 64-bit Windows platform”
- Disable “Include version information in project” under “Target” settings “All configurations – 32-bit Windows platform” and “All configurations – 64-bit Windows platform”

Read the rest of this entry »
Posted in Delphi, Development, Software Development | 1 Comment »
Posted by jpluimers on 2018/06/26
I totally missed that this was introduced in Delphi XE8: [Archive.is] Settings Migration Tool – RAD Studio.
It allows exporting/importing your Delphi settings and migrate them from older Delphi versions.
I need to try to find out which older Delphi versions it supports.
–jeroen
via: [WayBack] For once, I remembered …\Studio\19.0\bin\migrationtool.exe and imported all the IDE tweaks and color settings I had… – Lars Fosdal – Google+
Read the rest of this entry »
Posted in Delphi, Development, Software Development | 4 Comments »