Thinking on SQL and strings
Thinking on SQL and strings
https://github.com/tothpaul/DelphiTips/tree/master/SQLStrings
In fact, I'd like to have such feature at compile time :)
https://github.com/tothpaul/DelphiTips/tree/master/SQLStrings
https://github.com/tothpaul/DelphiTips/tree/master/SQLStrings
In fact, I'd like to have such feature at compile time :)
https://github.com/tothpaul/DelphiTips/tree/master/SQLStrings
BTW is it possible to write something like that ?
ReplyDeletevar
v: TSQLString;
s: string;
begin
v := s;
end;
I would like to avoid the TSQLString.Init() call but I can't see a way to do that.
even this code override v to a variant string loosing the SQLString stuffs
var
v: Variant;
s: string;
begin
TSQLString.Init(v, '');
v := s; // v is no more a SQLString
end;
docwiki.embarcadero.com - Operator Overloading (Delphi) - RAD Studio
ReplyDeleteJacek Laskowski I know, but AFAIK there's no Assign operator, Delphi just clear the target variant before changing it's type to vtString
ReplyDeletePaul TOTH but did you try this trick? :-)
ReplyDeleteclass function &&op_Implicit(a: string): TSQLString;
Jacek Laskowski TSQLString is not a type, it's a Variant handler...don't see where I could put the operator...
ReplyDeletePaul TOTH Okay, I've read about the custom variant, so ... you have a problem, sorry :-)
ReplyDeleteMaybe it will be useful ...
lnssoftware.ca - Steve’s Blog » Blog Archive » Custom Variants in Delphi
Attila Kovacs you cannot switch a 10 years old project to ORM with a wizard wand, but you can simplify your work with simple concepts like this SQLString
ReplyDelete