{"id":354,"date":"2022-01-07T18:30:10","date_gmt":"2022-01-07T21:30:10","guid":{"rendered":"https:\/\/gladiston.net.br\/?page_id=354"},"modified":"2022-07-13T16:05:16","modified_gmt":"2022-07-13T19:05:16","slug":"multi-paste-como-usar","status":"publish","type":"page","link":"https:\/\/gladiston.net.br\/en\/programacao\/lazarus-ide\/multi-paste-como-usar\/","title":{"rendered":"Multi Paste, how to use it"},"content":{"rendered":"<p>Many spend so much time with an IDE that they no longer care to know what&#039;s new with each new version. This is a mistake because when discovering something new, you ask yourself \u201cwhy didn&#039;t I know about it before?\u201d.<\/p>\n\n\n\n<p>This is the impression made by some when they discover the function&nbsp;<strong>Multi Paste<\/strong>. After all, what is it for?<\/p>\n\n\n\n<p>We often look in the IDE for the function called&nbsp;<strong>column mode<\/strong>&nbsp;or&nbsp;<strong>search\/replace<\/strong>&nbsp;because we \u201cpaste\u201d (Ctrl+V) texts and then want to add something to the right and\/or left of it. THE&nbsp;<strong>multi paste<\/strong>&nbsp;is a superior way to resolve this type of situation, I like to call it a&nbsp;<strong>custom \u201cnecklace\u201d<\/strong>&nbsp;because you can customize it before the final result.<\/p>\n\n\n\n<p>Let&#039;s take a better example, imagine you have the following query in your clipboard area:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select a.razao_social, a.cnpj, a.endereco, a.end_numero, a.en<span style=\"background-color: inherit; font-size: inherit; color: var(--global--color-foreground);\">d_complement,<\/span><code>  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 &#039;a%&#039;<\/code><\/code><\/pre>\n\n\n\n<p>You want to use the above query in your program, and in Pascal you will need to adapt it leaving it like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Query1.SQL.Add(&#039;select&#039;);<br>Query1.SQL.Add(&#039; a.razao_social, &#039;);<br>Query1.SQL.Add(&#039; a.cnpj,&#039;);<br>Query1.SQL.Add(&#039; a.address,&#039;);<br>Query1.SQL.Add(&#039; a.end_number, &#039;);<br>Query1.SQL.Add(&#039; a.end_complement, &#039;);<br>Query1.SQL.Add(&#039; a.end_neighborhood, &#039;);<br>Query1.SQL.Add(&#039; a.end_city, &#039;);<br>Query1.SQL.Add(&#039; a.end_cep, &#039;);<br>Query1.SQL.Add(&#039; a.end_uf, &#039;);<br>Query1.SQL.Add(&#039; a.end_state, &#039;);<br>Query1.SQL.Add(&#039; a.end_country, &#039;);<br>Query1.SQL.Add(&#039; a.status,&#039;);<br>Query1.SQL.Add(&#039; a.status_com&#039;);<br>Query1.SQL.Add(&#039;from clients to&#039;);<br>Query1.SQL.Add(&#039;where a.razao_social like &#039;&#039;a%&#039;&#039;&#039;);<\/pre>\n\n\n\n<p>Using the\u00a0<strong>column mode<\/strong>\u00a0and\/or\u00a0<strong>search\/replace<\/strong>\u00a0you would add\u00a0<strong>Query1.SQL.Add(&#039;<\/strong>\u00a0to the left and <strong>&#8216;);<\/strong>\u00a0on the right<br>and then it would clean whitespace and double quotes, am I right?<\/p>\n\n\n\n<p>But the&nbsp;<strong>multi paste<\/strong>&nbsp;solves the problem in a more practical way, see how:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Copy the desired query to the clipboard area.<\/li><li>Go to the program line where you want the custom \u201cpaste\u201d.<img decoding=\"async\" src=\"https:\/\/gladiston.github.io\/hello_lazarus\/assets\/productivity_multi_paste1.png\" alt=\"Posicionando-se onde deseja fazer o colar a-la-carte\" width=\"auto\" height=\"auto\"><\/li><li>Go in&nbsp;<strong>Edit|Multi paste<\/strong>&nbsp;and put in&nbsp;<strong>Text before each line<\/strong>&nbsp;the following text:<br><strong>Query1.SQL.Add(&#039;<\/strong><br>is at&nbsp;<strong>Text after each line<\/strong>&nbsp;the following text:<br><strong>&#8216;);<\/strong><br>now uncheck the option&nbsp;<strong>Trim clipboards contents<\/strong>&nbsp;so we don&#039;t lose the indentation of our SQL, as we can see in the image:<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gladiston.github.io\/hello_lazarus\/assets\/productivity_multi_paste2.png\" alt=\"Usando o Multi paste\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\"><li>Note that you can have a&nbsp;<strong>preview<\/strong>&nbsp;of how the personalized \u201cnecklace\u201d will look<\/li><li>Once confirmed, your code will look like this:<img decoding=\"async\" src=\"https:\/\/gladiston.github.io\/hello_lazarus\/assets\/productivity_multi_paste3.png\" alt=\"Resultado final\" width=\"auto\" height=\"auto\"><br>Your code\/query is already correctly quoted closing its pairs.<\/li><\/ol>\n\n\n\n<p>Still in doubt? Watch the video:&gt; https:\/\/www.youtube.com\/embed\/7mKy2h2GD5I<\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gladiston.github.io\/hello_lazarus\/assets\/productivity_multi_paste4.png\" alt=\"Resultado com concatena\u00e7\u00e3o\"\/><\/figure>\n\n\n\n<p>The usefulness of this\u00a0<strong>multi paste<\/strong>\u00a0is quite wide, make the most of the feature.<\/p>\n\n\n\n<p>If you have doubts about the features, watch the video below:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Productivity with Lazarus IDE: Multi Paste, how to use\" width=\"580\" height=\"326\" src=\"https:\/\/www.youtube.com\/embed\/7mKy2h2GD5I?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>","protected":false},"excerpt":{"rendered":"<p>Muitos ficam tanto tempo com uma IDE que n\u00e3o se importam mais em saber as novidades que ela possui a cada vers\u00e3o nova. Isso \u00e9 um erro porque ao descobrir uma novidade, se pergunta &#8220;por que n\u00e3o a conhec\u00ed antes?&#8221;. Essa \u00e9 a impress\u00e3o causada em alguns quando descobrem a fun\u00e7\u00e3o&nbsp;Multi Paste. Afinal, para qu\u00ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":159,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/template-full-width.php","meta":{"footnotes":""},"class_list":["post-354","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/comments?post=354"}],"version-history":[{"count":3,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/354\/revisions"}],"predecessor-version":[{"id":495,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/354\/revisions\/495"}],"up":[{"embeddable":true,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/159"}],"wp:attachment":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/media?parent=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}