Board logo

Subject: Convert to string change request [Print This Page]

Author: Edelcom    Time: 2008-8-25 17:54     Subject: 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).
Author: Passion    Time: 2008-8-28 10:44

In first step of replacing, why not replace "#13#10 +" with a blank?
Author: Edelcom    Time: 2008-9-8 17:57

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 ?
Author: Passion    Time: 2008-9-9 21:49

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.
Author: Passion    Time: 2008-9-10 09:57

Done. Please try try 442?

Welcome to CnPack Forum ( Powered by Discuz! 5.0.0