Freeware "Structural Highlighting" for Delphi 2007 IDE - delphi

I'm in the middle of sorting out a nested set of if/then begin/end pairs, and missing the heck out of CodeRush's structural highlighting (which I used to have in Delphi 6, and loved). Is there a freeware IDE add-in out there that will accomplish the same for Delphi 2007?
Note: I know Castalia does this as well. I tried Castalia a while back, and had trouble w/its stability; also don't really feel like spending $99 at the meoment for just this one feature, (plus maybe the split-editor feature). I may anyway, but thought I'd ask here first to see if there are cheaper alternatives.
Thanks in advance.

cnPack has a feature like this (draws a tree showing the structure)

Step 1: edit the code to simply visually align the nested blocks according to good practice, with consistent indenting etc.
You might be able to use a "pretty printer" to assist in this one-off activity. There are lots of these out there (including one built in to Delphi 2010 these days, as of Delphi 2010, which is no use to you I imagine). I don't know how many of them work on code snippets, rather than relying on complete units however.
Step 2: if the number and level of nested blocks is such that it remains confusing and unclear, refactor to reduce the number and level of nesting.
The result: code that is readable in any medium, without needing to lean on IDE confections which won't always be available to you (e.g. if using SVN and viewing diffs via WebSVN or some other collaborative code review process that doesn't use an IDE with lots of bells and whistles installed).

GExpert is my favorite addin for Delphi. It is free, mature and I use it every day.
Some highlights:
VERY fast search in source. This is so valuable for me.
Convenient find function dialog by typing some characters en the name.
Match parantheses, begin/end, and some other types.
Everything can be handled by a shortcut.
Many other things that I don't use so much at the moment.

Related

Overriding the paint events in Formula One (1) in Delphi 7?

My company has a Delphi 7 application that relies on Formula One spreadsheets (TF1Book) for a key part of the application.
Users are pretty happy with the functionality actually, but it looks very dated now, especially now we have a Microsoft 2010 style ribbon interface throughout the rest of the application.
My question is whether it's possible to override the paint events for the TF1Book? It doesn't seem to expose anything and the source code isn't provided.
Thanks!
Formula One for Delphi is delivered as an ActiveX component. It is an excellent component, but it is somewhat aged now. In any case, you don't get the code, so you cannot make modifications. You are out of luck. You cannot change the appearance of Formula One.
My company used to use Formula One. We moved away from it a few years ago because we felt vulnerable without source code. We also had problems with the licensing of later versions of Formula One because the vendor wanted royalties which naturally we did not like. We anticipated 64 bit Delphi and took a decision to make sure we had source for all our external libraries.
We ended up using DevExpress ExpressSpreadsheet. It certainly looks more modern. And you can customise it. We are happy enough with it although the standard of coding is very low. We had to implement many bug fixes and performance improvements because the design was so bad. But, it is still probably the best option.

Is there a Delphi obfuscator that works for >= Delphi 2007

I used to use Pythia to obfuscate my D6 program. But it seems Pythia does not work anymore with my D2007.
Here's the link of Pythia (no update since early 2007) : http://www.the-interweb.com/serendipity/index.php?/archives/86-Pythia-1.1.html
From link above, here's what I want to achieve
Over the course of time, a lot of new language features were added.
Since there is no formal grammar available, it is very hard for tool vendors (including Embarcadero themselves) to keep their Delphi language parsers up at the same level as the Delphi Compiler.
It is one of the reasons it takes tool vendors a bit of time (and for Delphi generics support: a lot of time!) to update their tools, of they are update at all.
You even see artifacts of this in Delphi itself:
the structure pane often gets things wrong
the Delphi modelling and refactoring sometimes fails
the Delphi code formatter goes haywire
Pythia is the only obfuscator for the native Delphi language I know of.
You could ask them on their site if they plan for a newer version.
Personally, I almost never use obfuscators for these reasons:
reverse engineering non-obfuscated projects is difficult enough (it would take competitors long enough to reverse engineer, so the chance to lessen the backlog they already have in the first place is virtually zero)
their added value is limited when you have multi-project solutions (basically they only hide internal or private stuff)
they make bug hunting production code far too cumbersome
--jeroen
You may try UPX - Ultimate Packer for Executable). It will compress the resources and all the text entries are non-readable without de-compress first.
I don't know any good free solutions, but if you really need some protection you can always buy something like:
http://www.aspack.com/asprotect.html
or
http://www.oreans.com/themida.php

Upgrade from Delphi 2007 to Delphi 2010?

What should I worry about if I move to Delphi 2007 to 2010?
I've checked this article and there was a lot of interesting stuff but not precisely for this jump that I need.
To clarify my question and situation:
I have all 3td party components' code.
I will need the unicode, but not this year.
I need win 7 support - themes, form resize problems and etc.
I will be happy to have a decent help system.
Is ADO (dbGO) improved?
What headache to expect?
Thanks!
I will be happy to have a dissent help
system.
Sorry for you, the help content of Delphi2010 is better than Delphi2007, but far away from Delphi7.
There are many resources about unicode migration, and it is very easy to find.
I will just insist on 3rd party libs which is the difficult part.
You have the source code, good, but considering fixing unicode relates issue inside these components is very ambitious !
My advice: Check the compatibility of your 3rd party libs, check your code compatibility - fix all warnings, follow this good white paper from CodeGear : Delphi and Unicode
http://edn.embarcadero.com/article/38980
I need win 7 support - themes, form
resize problems and etc.
You already have themes in Delphi 2007. Not that 2007 is at 100% prepared for Win7 but themes is what important for most users so this is IMHO not argument to upgrate.
I will need the unicode, but not this
year.
If you plan to use Delphi 2011 and release Mac version of your software, why not do it step by step and take Unicode headache (?) today? I am not sure of answer, just worrying :-) I am in this situation, already have license for Delphi 2009 but still unused because of Unicode so I am in 2007.
A "Beginner" approach to Delphi 7/2007 (ansi strings) ports to 2009/2010 (unicode strings) is to blindly search and replace ALL occurrences of String and replace with AnsiString, similarly, blindly changing all instances of Char to AnsiChar. This quickly reveals itself to be painful, and stupid, and wrong. Thus chastened, the user (without reading the transition guides published by Embarcadero, written by Nick Hodges) will retreat and lick their wounds, and consider sticking with Delphi X forever (where X is in the set of [7,2007,myFavouriteVersionHere]).
The second approach is to download already-updated versions of any components you need, and only update the components you really can't find any newly updated source code for, yourself, and then proceed to updating your application code.
I find that it is worth doing this, if you either sell your application for money, or if you rely on your application to be of some usefulness to you, or your company. It is not only a question of upgrading to handle compiler differences, but upgrading, as you say, to handle platform differences. And not only the platform differences that you are mentioning above, but ones you didn't mention, like UAC, and changes in user-permissions on files and folders, and other priveleges. Does your application require the ability to write to folders inside C:\Program Files, and other things, etc? Those need to be fixed.
If your application is a typical "ball of mud", developed incrementally, and without an elegant object oriented design, and if (as is typical) your app doesn't even really meet the recommended specs that Microsoft published as part of Windows XP, in 2002, the you really have some catching up to do.
If it's all too much for you, you could consider contracting the work out. An expert could probably port the application from an old delphi version, to a new one, in a few hours, and train you how to do the maintenance from that point forward.

Delphi code generation

I need to speed up my coding, too much work, so I need be able to generate code.
Any tools, any ideas?
Delphi includes Live Templates, a completely scriptable and configurable system for generating code constructs of any size or complexity.
Live Templates are, in my view, one of the more under-appreciated features in Delphi.
Find out how to use them at: http://delphi.wikia.com/wiki/Delphi_Live_Templates
and
http://delphi.wikia.com/wiki/Live_Templates_Technical_Info
Live templates are completely scriptable, meaning you can write Delphi code to do whatever you want with them.
An extendable example can be found here:
http://cc.codegear.com/Item/26420
Not a very good idea IMHO. If you need generator, then probably you have lots of code that looks very similar, so instead of generator, better thing would be to rethink and refactor code you have.
That should result in less code that is easier to maintain and less code in future for similar tasks.
If you are doing database application, then you could use some good visual SQL query builder to help you create queries. That is part that Delphi was not very good (I don't know if it improved in D2007 and D2009)
EDIT - Regarding SQL generation
There's lots of comments about query builder.
Well, I suppose I'm spoiled. As I remember, Delphi before version 6 (or maybe even 5?), had decent visual query builder. I had 0 (zero) bugs in SQL when I selected fields in query designer, opposed to writing SQL by myself.
SQL is just string in Delphi, there is no compiler checking, so this was the best way to ensure that SQL is correctly written.
If you mean something like a modeling tool, you could try out ModelMaker.
Rather than trying to code generate, you should probably just obtain code to do the bulk of what you want to do.
There are hundreds of free products at Sourceforge for Delphi.
And there are hundreds of thousands of code samples at Google Code Search that you can use.
Plus lots thousands of free or purchaseable components at repositories such as Torry's Delphi Pages or Embarcadero's Code Central for Delphi
Using components already made is the fastest way to speed up your coding, and to add capabilities that you would never have been able to.
For me best way is by creating custom components, and then create designer for this component.
I have find that i spent most of the time writing code that read/write values from controls. So i created control that can read, write, validate values, and automatically fill form or stored procedure or directly generate SQL and execute.
Custom designer allows you to setup all properties easy. Now i don't write code for such trivial task i just put control , open designer and set properties and rules that must be satisfied.
ModelMaker Code Explorer speed up my coding in times. It has a nice hotkeys for synchronising implementation and declaration, so if you changed one, you don't have to search for it pair. Also, very nice feature is, method editing dialog. And many more.
Have you tried GExpert? It is a set of tools built to increase the productivity of Delphi and C++Builder programmers by adding several features to the IDE. GExperts is developed as Open Source software.
Other alternative is using project template by saving a framework into the IDE Repository, create your own components and frames.
I wrote a code generator calle CodeTypo. I'm used it in many production environment. You can find it here: http://dade2000.altervista.org/index.php?page=CodeTypo
It's still in beta phase but is usable and reasonably stable.
I'll migrate all content of this old site in the new one (www.danieleteti.it) in english. And I'll add some other info about CodeTypo and code generators.
The thing that sped up my Delphi coding the most was getting CodeRush for Delphi (via a DevExpress VCL subscription for Delphi 5, 6, 7) and setting up a ton of templates.

Best auto-update component(s) for Delphi

I am re-writing and/or consolidating a bunch of my "app framework" classes (basic mainform, about box, locking routines & purchase linking, auto-update, datamodule initializer, etc) -- Basically, I have a number of small potential shareware apps that I'm wanting to get out the door, and want to re-use code where I can, as well as build a framework for later apps to save time.
In one app I have auto-updating, I'm using LMD's WebUpdate, and am reasonably happy with it, but given that I'm re-vamping everything, I thought I'd see what the consensus is for "best approach" on this. I don't mind paying for commercial, nor using open source if that's best... just would rather not reinvent the wheel. (I've read: Delphi: How do you auto-update your applications?)
What is the best Auto-update component for Delphi Win 32 apps?
I use TmxWebUpdate. It's free, simple and easy to customize. I also own TMS Component Pack with TWebUpdate, but never really found a good incentive to switch.
I use TWebUpdate from TMS Components and am very happy with it. I haven't used LMD so unfortunately am not able to provide a comparison.
TMS also supply a whole raft of other components so if your re-writes require any else, especially if you want some shiny UI enhancements (TMS have a range of iPhone-style components) then the website is certainly worth a visit.
They seem fairly active in their support forums (although I haven't had need to use them for the WebUpdate component) and they have a fairly regular release cycle.
I have heard good compliment about TWebUpdate from Tmssoftware
also torry has much components for the same job, some are free and others are commericals.
Now what's the best?, it's depend on your needs, you already using one from LMD, which is a good company and I have very good experince with their components, but never used this one.
If you need a specific functionality, or you have some problems with the current one you are using, it's will be better to list them, so you will get a better answers, but it's hard to define the best, because every one has different experience and views.
I use TWebUpdate myself. It works, but the docs are a bit limited and it seems a bit buggy sometimes.
I have looked into LMD's (I have their full component pack), but it seemed to be much more limited than TWebupdate.
I'm also using TWebUpdate, and have to echo stg's comments on quality of support (good), and quality of documentation (spotty -- it's old, and doesn't always reflect their new features immediately).
You'll also find some places that stress the "roll your own" approach.
Remember that part of the auto-update issue is the tools that you will need to create the update "package" at your end. TMS Software makes a tool available for use with TWebUpdate, and it's reasonably well done. In my case, I'm "misusing" the component to deal with multiple files so that I can refresh additional related libraries, text files, etc. The update builder tool isn't really good for that. So there's some manual editing. But the updating part works well.
I'll also add a caution that you need to be careful with updates in Vista (and probably Windows 7). Writing to the protected places in the Program Files hierarchy was problematic for me. You may want to check that out with whatever component you use.
Have you considered Appwave from Embarcadero. It's not free and I don't know the price.

Resources