Every once in a while you see a question with some great code in the answers.
This is such a time: image – How to make a water effect on TImage or anything? – Stack Overflow.
–jeroen
Posted by jpluimers on 2014/10/21
Every once in a while you see a question with some great code in the answers.
This is such a time: image – How to make a water effect on TImage or anything? – Stack Overflow.
–jeroen
Posted in Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2014/10/15
The Delphi MESSAGE directive is a very powerful one, you can generate compiler hints, warnings and errors with it, even fatal ones that abort compilation.
The compiler will return error codes H1054 (hint), W1054 (warning), E1054 (error) or F1054 (fatal error), which in the documentation are known under the catch-all x1054.
You need to take a bit of care with message directives, especially with the quotes. For instance
{$Message Error 'Not implemented'}
gives you the error below, but continues compiling:
[DCC Error] E1054 Not implemented
However, if you forget the single quotes
{$Message Error Not implemented}
it gives you error E1030 (not x1054), which is a bit confusing as it is a catch-all for invalid directives:
[DCC Error] E1030 Invalid compiler directive: 'message'
Here is a full example (now moved to bitbucket) of all the message directives and compiler reactions you can get: Read the rest of this entry »
Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/10/14
Delphi and 3rd party tools keep some of the settings in your %AppData% directory. Much more convenient than the registry as they are easier to read and modify when needed (also easier to damage <g>). We’ll start with an overview where various versions of Delphi store their configuration files, then show how the Favourites on the Welcome Page are stored, then end with an overview of BDS, Company Names and Product Names. Read the rest of this entry »
Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, History, Software Development | 4 Comments »
Posted by jpluimers on 2014/10/07
Calling Randomize too often can make your Random numbers even less random.
Sometimes having the Randomize call in a unit initialization section is not practical.
Hence this little method that I think I first wrote back in the Turbo Pascal days:
procedure RandomizeIfNeeded();
begin
if RandSeed = 0 then
Randomize();
end;
–jeroen
Posted in Delphi, Delphi 1, 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 for PHP, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Pascal, Software Development, Turbo Pascal | 7 Comments »
Posted by jpluimers on 2014/09/30
I recently bumped into the NTCore website by Daniel Pisti.
At a client without my own VMs, I wanted to create a DebugBreak like function in Delphi, which I remembered from my Turbo Pascal days to be something like Inline($CC). So searching for both Delphi and INT 3, I found an EXE injection page at NTCore.
In Delphi, you can do this with a procedure like this, which cannot be inlined because it has an asm block:
procedure DebugBreak();
asm
int 3
end;(Reminder to self: sort out what to do here to break on an iOS device; Xcode has an alternative)
The site has information about system internals and software security posted as articles until 2009, when he switched to blog posts. Besides that, he has written a bunch of interesting articles at CodeProject. Read the rest of this entry »
Posted in Delphi, Development, Pascal, Power User, Software Development, Turbo Pascal, Windows, xCode/Mac/iPad/iPhone/iOS/cocoa | 3 Comments »
Posted by jpluimers on 2014/09/25
If you are going to do test driven development and unit testing, you should watch these videos and slide decks, most of them by Miško Hevery:
Posted in .NET, Agile, C#, Delphi, Development, Java, Java Platform, JavaScript/ECMAScript, Pascal, Scripting, Software Development, Unit Testing, VB.NET | 2 Comments »
Posted by jpluimers on 2014/09/24
A while ago, I had a client with an exception on a workstation.
There was no permission to run a debugger on their system, or use something like MadExcept or Exceptional Magic in their code base.
The exception looked like this:
--------------------------- Application Error --------------------------- Exception EInOutError in module MyApplication.exe at 001656B1.File access denied. --------------------------- OK ---------------------------
These are the steps to get at the source line in an x86 Delphi program (I still have to try the x64, but presume it works similarly): Read the rest of this entry »
Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | 3 Comments »
Posted by jpluimers on 2014/09/20
So I won’t forget: Abstract syntax tree builder for Delphi.
Abstract syntax tree builder for Delphi
DelphiAST Announce
roman.yankovsky.me
Based on CastaliaDelphiParser. Published with MPL license.
–jeroen
via: Does anyone know of a way to get an AST of a Delphi unit? Out of the various….
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/09/18
Nice!
On September 17th 2014 ModelMaker Tools released Code Explorer v 11.1.0 This update includes Delphi XE7 support.
–jeroen
via ModelMaker Code Explorer: Refactoring made Easy! – Class Explorer, Refactoring Browser for Delphi..
Posted in Delphi, Delphi XE7, Development, Software Development | Leave a Comment »