CnPack Forum


 
Subject: Convert to string change request
Edelcom
普通灌水员
Rank: 2


UID 37197
Digest Posts 0
Credits 51
Posts 18
点点分 51
Reading Access 10
Registered 2008-2-8
Location Belgium
Status Offline
Post at 2008-8-25 17:54  Profile | Site | Blog | P.M. 
Convert to string change request

I frquently use the convert to string option to change a pasted sql query into something like :
      Result :=
        'SELECT' +
        'A_FIELD,' +  
        'ANOTHER_FIELD,' +   
        'A_THIRDFIELD' +   
        'FROM A_TABLE '
        'WHERE ...
You get the picture.

I therefore had to delete the standard #10#13 (for Delphi). I Replaced it with a blank.

Howerver at that time two + -signs are present (which is wrong):
        'ANOTHER_FIELD,' +   +
        'A_THIRDFIELD ' +   +
        'FROM A_TABLE '
The second + should be deleted.

Also it would be very helpfull to be able to specify that an extra space should be inserted before the closing '-sign.
        'SELECT ' +
        'A_FIELD, ' +  
        'ANOTHER_FIELD, ' +   
        'A_THIRDFIELD ' +   
        'FROM A_TABLE '
        'WHERE ...
because the string is an sql syntax extra spaces are necessary before any keyword (as FROM and WHERE).




Programmer by choice and profession!
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2008-8-28 10:44  Profile | Blog | P.M. 
In first step of replacing, why not replace "#13#10 +" with a blank?
Top
Edelcom
普通灌水员
Rank: 2


UID 37197
Digest Posts 0
Credits 51
Posts 18
点点分 51
Reading Access 10
Registered 2008-2-8
Location Belgium
Status Offline
Post at 2008-9-8 17:57  Profile | Site | Blog | P.M. 
Yes, Passion, I found that out too (look at the middle of my post).
But than I have two +  signs.
I is so easy for you developers to change this behavious ... I'm sure you will do it ,somehere in one of the next builds, no ?




Programmer by choice and profession!
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2008-9-9 21:49  Profile | Blog | P.M. 
In the 'Code to String' tool in Editor wizard, if you set the Delphi linebreak from #13#10 to a blank string, the conversion result will contain 2 + sign, which should be only one, is it correct?

If yes, I think I got it and will do the adjustment.
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2008-9-10 09:57  Profile | Blog | P.M. 
Done. Please try try 442?
Top
 




All times are GMT++8, the time now is 2024-11-22 05:58

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.012353 second(s), 9 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP