<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kb.sagedev.it/index.php?action=history&amp;feed=atom&amp;title=Funzione_replace</id>
	<title>Funzione replace - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://kb.sagedev.it/index.php?action=history&amp;feed=atom&amp;title=Funzione_replace"/>
	<link rel="alternate" type="text/html" href="https://kb.sagedev.it/index.php?title=Funzione_replace&amp;action=history"/>
	<updated>2026-11-28T07:14:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://kb.sagedev.it/index.php?title=Funzione_replace&amp;diff=1147&amp;oldid=prev</id>
		<title>Mwadmin at 14:34, 28 September 2026</title>
		<link rel="alternate" type="text/html" href="https://kb.sagedev.it/index.php?title=Funzione_replace&amp;diff=1147&amp;oldid=prev"/>
		<updated>2026-09-28T14:34:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:34, 28 September 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vedi anche AFNC.TRANSF, al menu GESASU.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#File YSAGEDEV&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#File YSAGEDEV&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mwadmin</name></author>
	</entry>
	<entry>
		<id>https://kb.sagedev.it/index.php?title=Funzione_replace&amp;diff=424&amp;oldid=prev</id>
		<title>94.102.143.228: Created page with &quot;&lt;pre&gt;# #File YSAGEDEV #  ############################################################################# # Author: SageDev.it # sostituisce tutte le occorrenze di OLD con NEW #...&quot;</title>
		<link rel="alternate" type="text/html" href="https://kb.sagedev.it/index.php?title=Funzione_replace&amp;diff=424&amp;oldid=prev"/>
		<updated>2021-06-24T08:12:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt;# #File YSAGEDEV #  ############################################################################# # Author: SageDev.it # sostituisce tutte le occorrenze di OLD con NEW #...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;#&lt;br /&gt;
#File YSAGEDEV&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#############################################################################&lt;br /&gt;
# Author: SageDev.it&lt;br /&gt;
# sostituisce tutte le occorrenze di OLD con NEW&lt;br /&gt;
# STR è un clob&lt;br /&gt;
#############################################################################&lt;br /&gt;
Funprog REPLACE(STR, OLD, NEW)&lt;br /&gt;
    Value Clbfile STR()&lt;br /&gt;
    Value Char OLD()&lt;br /&gt;
    Value Char NEW()&lt;br /&gt;
    Local Integer LENOLD&lt;br /&gt;
    Local Integer LENNEW&lt;br /&gt;
&lt;br /&gt;
    #lunghezza della stringa da sostituire&lt;br /&gt;
    LENOLD= len(OLD)&lt;br /&gt;
    #lunghezza della stringa che sostituirà la OLD&lt;br /&gt;
    LENNEW= len(NEW)&lt;br /&gt;
&lt;br /&gt;
    If LENOLD&amp;lt;=0 or LENOLD&amp;gt;len(STR)&lt;br /&gt;
        #la stringa da sostituire è vuota o è più lunga della stringa iniziale, quindi non sostituisco niente&lt;br /&gt;
        End STR&lt;br /&gt;
    Endif&lt;br /&gt;
&lt;br /&gt;
    Local Integer INDEX&lt;br /&gt;
    Local Integer INDEXSTART&lt;br /&gt;
&lt;br /&gt;
    #cerco la stringa da sostituire&lt;br /&gt;
    INDEX=instr(1,STR,OLD)&lt;br /&gt;
&lt;br /&gt;
    While INDEX&amp;gt;0&lt;br /&gt;
        #INDEX&amp;gt;0 significa che è stata trovata una corrispondenza di OLD&lt;br /&gt;
        #sostituisco l'occorrenza di OLD con la stringa NEW&lt;br /&gt;
        STR =left$(STR, INDEX-1) + NEW + right$(STR, INDEX+LENOLD)&lt;br /&gt;
&lt;br /&gt;
        #calcolo l'indice a cui finisce la stringa NEW inserita&lt;br /&gt;
        INDEXSTART=INDEX+LENNEW&lt;br /&gt;
&lt;br /&gt;
        #cerco la stringa da sostituire a partire dalla fine dell'ultima corrispondenza trovata&lt;br /&gt;
        INDEX=instr(INDEXSTART,STR,OLD)&lt;br /&gt;
    Wend&lt;br /&gt;
End STR&lt;br /&gt;
#############################################################################&lt;br /&gt;
&lt;br /&gt;
#############################################################################&lt;br /&gt;
# Author: SageDev.it&lt;br /&gt;
# Wrapper di REPLACE(STR, OLD, NEW)&lt;br /&gt;
# sostituisce tutte le occorrenze di OLD con NEW&lt;br /&gt;
# il parametro STR è un CHAR(), non un clob&lt;br /&gt;
#############################################################################&lt;br /&gt;
Funprog REPLACESTR(STR, OLD, NEW)&lt;br /&gt;
    Value Char STR()&lt;br /&gt;
    Value Char OLD()&lt;br /&gt;
    Value Char NEW()&lt;br /&gt;
&lt;br /&gt;
    Local Char RET(250)&lt;br /&gt;
    Local Clbfile STRCLB(1)&lt;br /&gt;
    STRCLB = STR&lt;br /&gt;
    RET = func YSAGEDEV.REPLACE(STRCLB, OLD, NEW)&lt;br /&gt;
End RET&lt;br /&gt;
#############################################################################&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>94.102.143.228</name></author>
	</entry>
</feed>