Multi Paste, how to use it

Many spend so much time with an IDE that they no longer care to know what's new with each new version. This is a mistake because when discovering something new, you ask yourself “why didn't I know about it before?”.

This is the impression made by some when they discover the function Multi Paste. After all, what is it for?

We often look in the IDE for the function called column mode or search/replace because we “paste” (Ctrl+V) texts and then want to add something to the right and/or left of it. THE multi paste is a superior way to resolve this type of situation, I like to call it a custom “necklace” because you can customize it before the final result.

Let's take a better example, imagine you have the following query in your clipboard area:

select a.razao_social, a.cnpj, a.endereco, a.end_numero, a.end_complement,  a.end_neighborhood, a.end_cidade, a.end_cep, a.end_uf, a.end_estado, a.end_pais, a.status, a.status_com from customers a where a.razao_social like 'a%'

You want to use the above query in your program, and in Pascal you will need to adapt it leaving it like this:

Query1.SQL.Add('select');
Query1.SQL.Add(' a.razao_social, ');
Query1.SQL.Add(' a.cnpj,');
Query1.SQL.Add(' a.address,');
Query1.SQL.Add(' a.end_number, ');
Query1.SQL.Add(' a.end_complement, ');
Query1.SQL.Add(' a.end_neighborhood, ');
Query1.SQL.Add(' a.end_city, ');
Query1.SQL.Add(' a.end_cep, ');
Query1.SQL.Add(' a.end_uf, ');
Query1.SQL.Add(' a.end_state, ');
Query1.SQL.Add(' a.end_country, ');
Query1.SQL.Add(' a.status,');
Query1.SQL.Add(' a.status_com');
Query1.SQL.Add('from clients to');
Query1.SQL.Add('where a.razao_social like ''a%''');

Using the column mode and/or search/replace you would add Query1.SQL.Add(' to the left and ‘); on the right
and then it would clean whitespace and double quotes, am I right?

But the multi paste solves the problem in a more practical way, see how:

  1. Copy the desired query to the clipboard area.
  2. Go to the program line where you want the custom “paste”.Posicionando-se onde deseja fazer o colar a-la-carte
  3. Go in Edit|Multi paste and put in Text before each line the following text:
    Query1.SQL.Add('
    is at Text after each line the following text:
    ‘);
    now uncheck the option Trim clipboards contents so we don't lose the indentation of our SQL, as we can see in the image:
Usando o Multi paste
  1. Note that you can have a preview of how the personalized “necklace” will look
  2. Once confirmed, your code will look like this:Resultado final
    Your code/query is already correctly quoted closing its pairs.

Still in doubt? Watch the video:> https://www.youtube.com/embed/7mKy2h2GD5I

The example above was with a query, but think of any type of code that you need to copy and paste and then customize it to be useful within components that deal with code coming from other areas such as HTML, XML, JSON... transport into a component or concatenate it later. See this concatenation:

Resultado com concatenação

The usefulness of this multi paste is quite wide, make the most of the feature.

If you have doubts about the features, watch the video below: