Re: [Lazarus] IDE option: Convert selection to string ?

2018-07-12 Thread Martin Frb via Lazarus

On 12/07/2018 14:19, Michael Van Canneyt via Lazarus wrote:


It would be nice if the IDE could do this:
select a block of text, and choose 'Refactoring -> convert to pascal 
string'


Currently I have a separate tool that does this (both ways: quote and 
unquote, in case I need to re-rest an SQL statement from my code) but 
it would be a lot faster if the IDE could do it for me. Most likely it 
already contains code

that does similar things like this.


While it would be nice as a build in, you can always add it as pascal 
script macro.

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE option: Convert selection to string ?

2018-07-12 Thread Michael Van Canneyt via Lazarus



On Thu, 12 Jul 2018, Martin Frb via Lazarus wrote:


On 12/07/2018 14:36, Anthony Walter via Lazarus wrote:
How about something that takes the current caret position in the 
source editor, the clipboard context, and inserts as a Pascal quoted 
string that wraps with + at the end of line, and appropriate system 
defined line break characters?


The command for this would be in the menu as "Edit -> Paste as 
String", and reassignable through custom keyboard bindings.


This would be easy enough to add, but for me unfortunately I've been 
busy with moving and renovating my house. When I'm done if no one else 
has added it, I might write it as an add on package.



For this, have a look ot menu Edit > Multi line paste


'Multipaste'

Very nice, these hidden gems... :)

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE option: Convert selection to string ?

2018-07-12 Thread Martin Frb via Lazarus

On 12/07/2018 14:36, Anthony Walter via Lazarus wrote:
How about something that takes the current caret position in the 
source editor, the clipboard context, and inserts as a Pascal quoted 
string that wraps with + at the end of line, and appropriate system 
defined line break characters?


The command for this would be in the menu as "Edit -> Paste as 
String", and reassignable through custom keyboard bindings.


This would be easy enough to add, but for me unfortunately I've been 
busy with moving and renovating my house. When I'm done if no one else 
has added it, I might write it as an add on package.



For this, have a look ot menu Edit > Multi line paste
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE option: Convert selection to string ?

2018-07-12 Thread Marcos Douglas B. Santos via Lazarus
On Thu, Jul 12, 2018 at 9:19 AM, Michael Van Canneyt via Lazarus
 wrote:
>
> I cannot imagine I am the only one with this need :)

+1
Of course you're not alone!

Marcos Douglas
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] IDE option: Convert selection to string ?

2018-07-12 Thread Michael Van Canneyt via Lazarus


Hello,

The IDE contains a 'make resource string' refactoring option.

This requires the selection to be a pascal string.

However, I quite often find myself in the need to create a string constant
from arbitrary text:

I test an SQL statement in an SQL tool, and then I copy it to the pascal source
file where I need it. I must then manually convert it to a string constant
by adding the necessary quotes, doubling single quotes already there and 
appending +sLineBreak+ etc.


It would be nice if the IDE could do this:
select a block of text, and choose 'Refactoring -> convert to pascal string'

Currently I have a separate tool that does this (both ways: quote and unquote, 
in case I need to re-rest an SQL statement from my code) but it would be a lot 
faster if the IDE could do it for me. Most likely it already contains code

that does similar things like this.

I cannot imagine I am the only one with this need :)

Any chance of getting such a feature ?

Michael.





--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LCL_FULLVERSION is not recognized

2018-07-12 Thread Rik van Kekem via Lazarus

On 12-07-2018 12:51, frans via Lazarus wrote:

I use Lazarus 1.6.4 (temporarely) and lazarus 1.8.4 on Windows 10.
I need to use the LCL version but I can't get it to work properly.
I use the following code:
  {$IFDEF LCL_FULLVERSION > 108}
  {$ELSE}
  {$ENDIF}
Compiling the program give me the message Warning include environment 
"LCL_FULLVERSION" not found in environment. But this is the way I 
fount on the lazarus forum.
What am I doing wrong? And where can I find a list of all Lazarus 
environment variables?



Where did you find this on the forum?
Because you shouldn't use {$IFDEF } but {$IF } (because you are using an 
expression)


So:
{$IF LCL_FULLVERSION > 108}
{$ELSE}
{$ENDIF}

If you use {$IFDEF it will check if "LCL_FULLVERSION > 108" is 
defined, which it isn't.


Also see http://www.math.uni-leipzig.de/pool/tuts/FreePascal/prog/node4.html

B.T.W. You need to include "uses lclversion" because LCL_FULLVERSION is 
declared there (otherwise you get a ansistring error message).


Some other constants: 
http://lazarus-ccr.sourceforge.net/docs/lcl/lclversion/index-2.html


Grtz,
Rik

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] LCL_FULLVERSION is not recognized

2018-07-12 Thread frans via Lazarus

Hi.

I use Lazarus 1.6.4 (temporarely) and lazarus 1.8.4 on Windows 10.
I need to use the LCL version but I can't get it to work properly.
I use the following code:
  {$IFDEF LCL_FULLVERSION > 108}
  {$ELSE}
  {$ENDIF}
Compiling the program give me the message Warning include environment 
"LCL_FULLVERSION" not found in environment. But this is the way I fount 
on the lazarus forum.
What am I doing wrong? And where can I find a list of all Lazarus 
environment variables?


--
mvg
Frans van Leeuwen
M 06-51695390


---
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus