I needed to modify some code that had been amended from the Delphi TParser class (which parses DFM files, but can be amended to other sources as well), so here are some links I found during my research:
Be sure to watch the presenter Stefan Eggermont (StackOverflow, Twitter, LinkedIn, GitHub, FOSDEM, website www.legacycode.nl) as this kind of analysis (that is also possible for other languages and tools) can highly speedup your work.
Even in unsuspiciously looking code, the wit statement can bite you, especially if you need to do refactoring and (because of that) introduce two names in the same scope.
Whilst upgrading the code to remove the Containers unit (its not supported on NextGen platforms, so I have to make things work with Generics.Collections instead, (bye bye D7 support for this code) and refactor a couple stupidities in my original design (they always creep in, don’t they) I ended up with two class members of the same name. The with block then looked OK but I was in fact not access the member I thought I was.
Every once in a while you have multiple threads or processes wanting to write a short message to the same log file. Append then will give you an I/O error 32 (ERROR_SHARING_VIOLATION), but the below small routine will sleep a bit while retrying a couple of times.
in $I- mode, you access the IOResult to obtain the results of those I/O operations
IOResult gets the result of the last failed operation (if any) or zero if none failed
IOResult clears the underlying storage to zero
$IFOPT checks for a certain state of a compiler flag
You can store the state of $OPT in a temporary conditional define
Note there are a few tables of codes you can get back through IOResult as basically you can get many GetLastError results in IOResult as well: Read the rest of this entry »
Make sure your EXE can write in the directory of the EXE.
The first makes sure all units are compiled with FullDebugMode (Delphi does not always do that automagically).
The second makes sure your EXE can access the DLL that writes out your *MemoryManager_EventLog.txt file containing memory leaks and other issues FastMM4 detected.
Every now and then I need to go back to an old Delphi version, which nowadays means try and get it and all the tools installed on something newer than Windows XP.
When installing on Windows Vista and up (I usually run Windows 7 or 8.1), the DelphiSpeedUp installer barfs with something like this:
---------------------------
Installdelphispeedup105
--------------------------- Cannot register DelphiSpeedUpLoader.bpl.
---------------------------
OK
---------------------------