Re: Extracting SQL into resourceStrings...Tool?
- From: "Herbert Sitz" <hsitz@xxxxxxxxxx>
- Date: Wed, 29 Mar 2006 13:47:53 -0600
"Randy Magruder" <rmagruder@xxxxxxxxxxxx> wrote in message
news:442ae31d$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Johannes Bjerregaard wrote:
If the programming style is consistent,
ROFL->LMAO :) It's hard enough getting a small team to be consistent
let alone a code-inheritance chain that dates back to '96 and God knows
how many developers. It's a mess...I wish I could count on consistency
:)
you could probably use the
Delphi editor's macro recorder to do most of the work.
I often do. But I want to go a step beyond that.
Not sure why you would use resource strings rather than consts, it
doesn't seem like the kind of thing that needs to be localized.
Honestly, I don't care if they are consts or resourceStrings. I just
want the injected SQL OUT of the source files like this.
Randy
I have no help for automatically extracting the SQL; parsing the code with
regular expressions seems like best way to me.
Also, might not be exactly what you want, but if the resource string doesn't
work you might want to read a 3-part series of articles in Delphi Informant
written a few years ago by Rick Spence on creating a component by
subclassing TQuery to store SQL strings in a database and automatically
retrieve them as the TQuery was opened. I remember trying it out with
TDBISAMQueries and thought it was neat. Has advantages over extracting to
resource strings because having the sql in the db itself makes easier to
edit, create versions for different db's, etc. I'm sure there is some
performance hit, but I'm guessing it would be minimal. (Not sure, but the
method in the article could also probably be adopted to get the SQL strings
from resource strings.) Anyway, the code and articles would be available on
the Delphi Informant CD:
http://www.delphizine.com/
-- Herb Sitz
.
- Prev by Date: Re: FastMM and memory leaks
- Next by Date: Master/detail change problem
- Previous by thread: ANN: IB LogManager - "Get in touch" flash movies have been uploaded
- Next by thread: Master/detail change problem
- Index(es):
Relevant Pages
|