News, Blogs, and Tips

IDE Fix Pack 5.91 – Bugfix release

Andy’s Blog and Tools - Thu, 04/23/2015 - 11:35

There was a bug in the TStringList.IndexOf performance optimization that didn’t take into account that DB.TFlatList overrides GetCount and implements lacy loading. The optimization directly accessed TStringList.FCount which was zero because GetCount wasn’t called. This bug appeared when you tried to open a DataSet in the IDE.

Another problem was that the fastdcc*.exe files in the XE7 and XE8 fastdcc 7zip file were from a pre-XE3 version and used “fastdccXx.dll” instead of “fastdccXx.dllx” (that is necessary since XE3’s copy protection changes). This prevented the CompilerSpeedPack to be injected into the compiler’s process.

Changelog:

  • Fixed: IDEFixPack didn’t take into account that DB.TFlatList uses late loading through GetCount
  • Fixed: fastdcc32/64/aarm in XE7 and XE8 didn’t load the CompilerSpeedPack into the compiler’s process

IDE Fix Pack download:

Name IDE Version File Size Downloads Added IDE Fix Pack 5.92 2009 (UP4) IDEFixPack2009Reg592.7z 178.64 KB 1094 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) 2010 (UP5) IDEFixPack2010Reg592.7z 174.62 KB 1610 times 2015-05-16 IDE Fix Pack 5.92 XE (UP1) IDEFixPackXEReg592.7z 160.94 KB 620 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE2 (UP4+HF1 IDEFixPackXE2Reg592.7z 233.92 KB 579 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE3 (UP2) IDEFixPackXE3Reg592.7z 186.52 KB 378 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE4 (UP1) IDEFixPackXE4Reg592.7z 187.13 KB 314 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE5 (UP2) IDEFixPackXE5Reg592.7z 186.26 KB 498 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE6 (UP1) IDEFixPackXE6Reg592.7z 304.41 KB 466 times 2015-05-16 IDE Fix Pack 5.92 XE7 (UP1) IDEFixPackXE7Reg592.7z 318.54 KB 1583 times 2015-05-16 IDE Fix Pack 5.92 XE8 IDEFixPackXE8Reg592.7z 311.5 KB 2230 times 2015-05-16

fastdcc download:

Name IDE Version File Size Downloads Added fastdcc 5.92 2009 (UP4) fastdcc2009v592.7z 76.36 KB 184 times 2015-05-16 fastdcc 5.92 (unsupported) 2010 (UP5) fastdcc2010v592.7z 80.6 KB 280 times 2015-05-16 fastdcc 5.92 XE (UP1) fastdccXEv592.7z 82.47 KB 205 times 2015-05-16 fastdcc 5.92 (unsupported) XE2 (UP4+HF1) fastdccXE2v592.7z 103.87 KB 185 times 2015-05-16 fastdcc 5.92 (unsupported) XE3 (UP2) fastdccXE3v592.7z 118.14 KB 151 times 2015-05-16 fastdcc 5.92 (unsupported) XE4 (UP1) fastdccXE4v592.7z 112.92 KB 145 times 2015-05-16 fastdcc 5.92 (unsupported) XE5 (UP2) fastdccXE5v592.7z 114.11 KB 177 times 2015-05-16 fastdcc 5.92 (unsupported) XE6 (UP1) fastdccXE6v592.7z 138.34 KB 193 times 2015-05-16 fastdcc 5.92 XE7 (UP1) fastdccXE7v592.7z 150.38 KB 377 times 2015-05-16 fastdcc 5.92 XE8 fastdccXE8v592.7z 146.87 KB 641 times 2015-05-16
Categories: News, Blogs, and Tips

How to specify parameters in a report through the command line

DAC Team - Thu, 04/23/2015 - 07:49
dbForge Studio for SQL Server gives you an opportunity of automating the variety database management processes. One of them is specifying parameters in a report making use the command line. The /parameters switch is used to specify values for parameters declared in a query script. To perform this task, you need only type the name of […]
Categories: News, Blogs, and Tips

IDE Fix Pack 5.9 for RAD Studio 2009-XE8

Andy’s Blog and Tools - Tue, 04/21/2015 - 11:29

The new IDE Fix Pack 5.9 adds support for RAD Studio XE8. It also fixes the long standing Code Insight bug QC 71270 (also 76338 and 76379) where the popup listbox doesn’t always show items with a double underscore or a “_Z”.

With XE8 the IDE comes with the Castalia IDE plugin. Unfortunately this causes the IDE to start a lot slower. IDE Fix Pack 5.9 addresses this performance bottleneck as you can see here.

Changelog:

  • Fixed: FieldAddress optimization could fail if a published field name was also used in an ancestor
  • Added: XE8 support
  • Added: TStringList.IndexOfName optimization
  • Added: Castalia XE8 startup optimization (XE8)
  • Added: Fix for QC 71270, 76338 and 76379. “CodeInsight doesn’t like the underscore”.

IDE Fix Pack download:

Name IDE Version File Size Downloads Added IDE Fix Pack 5.92 2009 (UP4) IDEFixPack2009Reg592.7z 178.64 KB 1094 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) 2010 (UP5) IDEFixPack2010Reg592.7z 174.62 KB 1610 times 2015-05-16 IDE Fix Pack 5.92 XE (UP1) IDEFixPackXEReg592.7z 160.94 KB 620 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE2 (UP4+HF1 IDEFixPackXE2Reg592.7z 233.92 KB 579 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE3 (UP2) IDEFixPackXE3Reg592.7z 186.52 KB 378 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE4 (UP1) IDEFixPackXE4Reg592.7z 187.13 KB 314 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE5 (UP2) IDEFixPackXE5Reg592.7z 186.26 KB 498 times 2015-05-16 IDE Fix Pack 5.92 (unsupported) XE6 (UP1) IDEFixPackXE6Reg592.7z 304.41 KB 466 times 2015-05-16 IDE Fix Pack 5.92 XE7 (UP1) IDEFixPackXE7Reg592.7z 318.54 KB 1583 times 2015-05-16 IDE Fix Pack 5.92 XE8 IDEFixPackXE8Reg592.7z 311.5 KB 2230 times 2015-05-16

fastdcc download:

Name IDE Version File Size Downloads Added fastdcc 5.92 2009 (UP4) fastdcc2009v592.7z 76.36 KB 184 times 2015-05-16 fastdcc 5.92 (unsupported) 2010 (UP5) fastdcc2010v592.7z 80.6 KB 280 times 2015-05-16 fastdcc 5.92 XE (UP1) fastdccXEv592.7z 82.47 KB 205 times 2015-05-16 fastdcc 5.92 (unsupported) XE2 (UP4+HF1) fastdccXE2v592.7z 103.87 KB 185 times 2015-05-16 fastdcc 5.92 (unsupported) XE3 (UP2) fastdccXE3v592.7z 118.14 KB 151 times 2015-05-16 fastdcc 5.92 (unsupported) XE4 (UP1) fastdccXE4v592.7z 112.92 KB 145 times 2015-05-16 fastdcc 5.92 (unsupported) XE5 (UP2) fastdccXE5v592.7z 114.11 KB 177 times 2015-05-16 fastdcc 5.92 (unsupported) XE6 (UP1) fastdccXE6v592.7z 138.34 KB 193 times 2015-05-16 fastdcc 5.92 XE7 (UP1) fastdccXE7v592.7z 150.38 KB 377 times 2015-05-16 fastdcc 5.92 XE8 fastdccXE8v592.7z 146.87 KB 641 times 2015-05-16
Categories: News, Blogs, and Tips

DDevExtensions 2.83 for XE8 released

Andy’s Blog and Tools - Tue, 04/21/2015 - 10:11

The DDevExtensions 2.83 IDE plugin is now available for RAD Studio XE8.

The only change compared to 2.82 is that XE8 is supported.

DDevExtensions download:

Name IDE Version File Size Downloads Added DDevExtensions 1.61 5-2007 DDevExtensions161Setup.zip 734.07 KB 15768 times 2009-01-10 DDevExtensions 2.8 Features PDF DDevExtensionsFeatures.pdf 602.92 KB 5616 times 2014-12-27 DDevExtensions 2.4 7, 2007 DDevExtensions24Setup7_2007.zip 535.41 KB 7399 times 2011-07-25 DDevExtensions 2.6 (legacy) XE2+UP3 DDevExtensionsSetup26.zip 800.68 KB 599 times 2013-11-28 DDevExtensions 2.83 2009-XE8 DDevExtensions283.7z 991.84 KB 2794 times 2015-04-21

Categories: News, Blogs, and Tips

Resolving RAD Studio XE7 Update 1 and RAD Studio XE8 Installation Crash

DAC Team - Tue, 04/21/2015 - 07:59
Since RAD Studio XE7 Update 1 was released, the ETTracker.dll library was added to installation. Its purpose is obscure, but its presence in the installation caused serious problems for Windows XP users when installing RAD Studio XE7 Update 1. Later some users on Windows 8 encountered the same problems. And finally, we have got the […]
Categories: News, Blogs, and Tips

IDE Fix Pack XE8 preview – Castalia’s slow initialization

Andy’s Blog and Tools - Sat, 04/11/2015 - 03:51

A short screen capture video of XE8’s splash screen. It shows how fast the Castalia IDE plugin starts if the upcoming IDE Fix Pack for XE8 is installed.

Categories: News, Blogs, and Tips

Byte-Strings for XE8’s mobile compilers

Andy’s Blog and Tools - Tue, 04/07/2015 - 13:21

Delphi’s NextGen compiler (Android, IOS) removed support for UTF8String, AnsiString and RawByteString. But if you look into System.pas you see that those types are still there but Embarcadero makes them inaccessible from outside of System.pas by prefixing them with an underscore that the compiler converts to the at-sign. And you can’t write “@UTF8String” as it is not a valid identifier.

By patching DCU files it is possible to make those hidden types accessible. And guess what, the compiler generates correct code for the “unsupported” strings.

The unit System.ByteStrings reintroduces:

  • ShortString
  • AnsiString
  • AnsiChar
  • PAnsiChar
  • PPAnsiChar
  • UTF8String
  • PUTF8String
  • RawByteString
  • PRawByteString

Usage:
Add the System.ByteStrings.dcu’s path to the compiler’s search path and add the unit to your uses clauses.

There is no *.PAS file because the DCU is patched with a hex editor to get access to the hidden types.

Name IDE Version File Size Downloads Added System.ByteStrings XE5 RTM/UP1 only XE5ByteStrings.7z 2.45 KB 731 times 2013-10-23 System.ByteStrings XE5 UP2 only XE5Up2ByteStrings.7z 2.85 KB 653 times 2013-12-20 System.ByteStrings XE6 XE6ByteStrings.7z 2.89 KB 517 times 2014-04-16 System.ByteStrings XE7 XE7ByteStrings.7z 2.89 KB 485 times 2015-01-20 System.ByteStrings XE8 XE8ByteStrings.7z 3.69 KB 422 times 2015-04-16
Categories: News, Blogs, and Tips

XE8 – Get rid of the wrong font size and blue toolbar

Andy’s Blog and Tools - Tue, 04/07/2015 - 12:24

With the new RAD Studio XE8, Embarcadero thought that Delphi looked too modern and the old CDE/Motif Java Swing style would look much more appropriate. XE8 also increased the font size of the main form including the menu bar, structure pane, object inspector, project manager, tool palette, call stack, …

Thanks to Daniel Wolf’s German blog post, I was able to restore the XE7 style. Unfortunately there is no simple configuration dialog in the IDE, so you have to make some changes to the registry by hand or download Daniel’s “wuppdi·StylerXE8” tool.

  1. Quit XE8
  2. Create a new file XE7StyleForXE8.reg file and paste the following content into it Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Embarcadero\BDS\16.0\ModernTheme] "FontName"="Segoe UI" "FontSize"=dword:00000009 "MainToolBarColor"="clBtnFace"
  3. Save the file and double click it so that the registry changes are applied to XE8.
  4. Start XE8

The IDE uses the following default values if the “ModernTheme” registry key doesn’t exist.

Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Embarcadero\BDS\16.0\ModernTheme] "FontName"="Segoe UI" "FontSize"=dword:0000000a "MainToolBarColor"="clGradientActiveCaption"

This is also described in the DocWiki.

Before:

After:

Categories: News, Blogs, and Tips

Random Thoughts on the Passing Scene #162

Nick Hodges - Mon, 06/14/2010 - 15:07
Categories: News, Blogs, and Tips

Delphi Pretty Good Practices #5 – Don’t Use Literals

Nick Hodges - Wed, 06/09/2010 - 11:03

If there is a bedrock, bottom line, everyone-should-follow-it-all-the-time rule in programming it is “The DRY Principle” – Don’t Repeat Yourself.  This simple rule states that you should write code once and only once, and that you shouldn’t allow the same code to be used all over the place.  Or, as the Wikipedia article deftly states: "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system."  Put more simply, it means that you shouldn’t have the same thing repeated all over your code, but that you should create a single identifier and use that in the many places where it might be needed.

As a practical matter, the DRY principle in its most basic form tells us that we should, as a matter of course, not use literals in our code, but instead should declare constants (or resourcestring types as we’ll discuss in a minute) and use those instead. That way, if you need to change the value for something, you can do it in a single place instead of having to make multiple, error-prone changes throughout your existing code.

For example:  Say you have a system that has an arbitrary number of required repetitions, say 17.  You might end up writing a whole bunch of code like this:

for i := 1 to 17 do begin ProcessStuff; DoSomeMoreStuff; end;

Now imagine that you have that kind of code all over the place, and then your boss comes around and says "Hey, we need to repeat all that stuff 18 times now, not just seventeen.” Well, if you haven’t followed the DRY Principle, you could very well end up with a lot of code to change.  And don’t use search and replace, because what if you change the 17 that is part of a variable name or something?  Things could get ugly fast.

Of course, the thing to do is to declare a constant:

const NumberOfRepetitions = 17;

and declare your loops as

for i := 1 to NumberOfRepetitions do begin ProcessStuff; DoSomeMoreStuff; end;

and now when your boss switches things up, you have but one simple change to make, and all is well.

Now this is a pretty simple, basic thing to do, but I’m constantly surprised at how often I find myself forgetting to do it.  (For instance, if you look through the code for TextScrubber, you’ll probably notice that I need to apply the DRY Principle to the TVersionInfo constructor in uTextScrubberTypes.pas.) You might be surprised how many literals you use in your code. I often take advantage of the syntax highlighting feature to scan code for specific colors for strings and numbers and replace them with constant values as much as possible. For instance, some code from TextScrubber used to look like this:

procedure TStraightTextMainForm.InitializeMainFormInformation; var IniFile: TIniFile; begin IniFile := TIniFile.Create(IniFileName); try TextScrubberOptions.ClickChoice := TClickChoice( IniFile.ReadInteger('Options', cClickChoice, 0)); TextScrubberOptions.ShouldTrim := IniFile.ReadBool(cOptions, 'ShouldTrimText', False); finally IniFile.Free; end; end;

with a bunch of string literals.  Instead, now, I’ve declared two constants in the uTextScrubberConsts.pas unit

const cOptions = 'Options'; cClickChoice = 'ClickChoice'; cShouldTrimText = 'ShouldTrimText'; cVersionLangCodePage = '040904E4';

and the new code looks like this:

procedure TStraightTextMainForm.InitializeMainFormInformation; var IniFile: TIniFile; begin IniFile := TIniFile.Create(IniFileName); try TextScrubberOptions.ClickChoice := TClickChoice( IniFile.ReadInteger(cOptions, cClickChoice, 0)); TextScrubberOptions.ShouldTrim := IniFile.ReadBool(cOptions, cShouldTrimText, False); finally IniFile.Free; end; end;

Those constants are also used when I write out information to the INI file, so that I can change the value in one place if I need to, and so that I can know that there won’t be any typographical errors in my strings that will cause a bug.  The same string value is always going to be used for the INI file entry.

Now let’s take a look specifically at strings.  Strings are a bit special because they are very often used to communicate information, and as such, they frequently need to be translated into other languages through the process of “localization”.  Windows provides an easy way to do this via string resources, and Delphi provides an easy way to create string resources via the resourcestring identifier.  These strings are then created as resources, making them easy to translate.  And “easy to translate” can often be, well, translated into “cheaper to translate” and that is a good thing.

Practically speaking, I apply this principle by placing as many const and resourcestring declarations as I can in a single file, thus centrally locating them for easy management and translation.  In our case with the TextScrubber project, I’ve created a file called uTextScrubberConsts.pas and put constants and resource string values into it.  If you look through the project code, you’ll probably notice that I need to apply the DRY Principle to the TVersionInfo constructor in uTextScrubberTypes.pas, even if it is keeping those constants within the unit.

One question that might get asked is “How do you choose what to make a const and what to make a resourcestring?”  My answer is that as a general rule, any string that could change without changing the UI or the functionality of the code, make a const.  Any string that, if changed, will trigger a change in UI or translation should be made a resourcestring.  There are exceptions to that, of course. More simply, a rule to use that anything that might get translated should be a resourcestring.

Now, this is a pretty simple “pretty good practice” to follow, but for you folks who have not been following this principle,  simply doing so can make your code more readable and maintainable.

Categories: News, Blogs, and Tips

Random Thoughts on the Passing Scene #161

Nick Hodges - Tue, 06/08/2010 - 15:27
Categories: News, Blogs, and Tips

Random Thoughts on the Passing Scene #160

Nick Hodges - Fri, 06/04/2010 - 10:43
  • The topic of newsgroup participation came up in our Delphi.non-technical group, and I mentioned that it appears that more people seem to be using StackOverflow to get answers to their questions.   Craig Stuntz turned around and in his own inimitable way, proved that such is the case.  I know that I check StackOverflow a couple of times a day, and try to make modest contributions.  I endeavor to vote for good answers and to give good answers when I can.  The cool part is that if you are only interesting in Delphi Programming questions, you can really make it “DelphiOverflow” by simply paying attention to the correct tags. 
  • Speaking of stuff on StackOverflow, Robert Love pointed out something I hadn’t seen before on there: Code-Golf.  This is a question that asks a small development problem, and then folks post their answers in their favorite languages using as few characters as possible (low score wins, like in golf).  Kind of fun.  Robert threw in a Delphi answer for this question, and he inspired me to post my own Code Golf problem.   So, if you are so inclined, I’d love to see a Delphi solution, though I’m sure it will be tough to compete with some of the command line scripting languages. Next time I’ll make the criteria be a command line EXE. 
  • Forgive me, but I found this quite funny. Please note the text bubble near the end. Now if she had decided to use Delphi, well, that might have been a different story.  I am also reminded that Jack Bauer uses Delphi – and I strongly recommend against crossing Jack Bauer.
  • I’ve mentioned that there is a new version of Delphi Prism – and one of it’s new features is the ability to put some C# code on the clipboard and paste it as Prism code.  If any of you is interested in automating the process, there is a command line version of that tool available.
  • Oh, and don’t worry, I haven’t given up on the “Pretty Good Practices” series.  I’ve got a few drafts in the queue, but they are a bit tougher to write than the Random Thoughts items.
Categories: News, Blogs, and Tips

Random Thoughts on the Passing Scene #159

Nick Hodges - Wed, 06/02/2010 - 12:52
Categories: News, Blogs, and Tips

Coin Flip

Nick Hodges - Sun, 05/30/2010 - 19:28

I had occasion to write a little routine called CoinFlip:

function CoinFlip: Boolean; begin Result := Random > 0.5; end;

I don’t know why I found it mildly amusing.  And I bet someone will tell me that it is slightly biased in one direction.  Because it is.  Anyway, thought you all might enjoy it, too.

Categories: News, Blogs, and Tips