<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Strip_Leading_Zeros</id>
	<title>Strip Leading Zeros - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Strip_Leading_Zeros"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Strip_Leading_Zeros&amp;action=history"/>
	<updated>2026-08-26T05:22:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Strip_Leading_Zeros&amp;diff=12183&amp;oldid=prev</id>
		<title>Davidnewcomb at 10:54, 4 April 2007</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Strip_Leading_Zeros&amp;diff=12183&amp;oldid=prev"/>
		<updated>2007-04-04T10:54:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 10:54, 4 April 2007&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-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;    Already applied: |0|&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;    Already applied: |0|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;    Completed&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;    Completed&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;[[Category:Code Examples]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;[[Category:Tutorials]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key n22049_wiki-wiki_:diff::1.12:old-12182:rev-12183 --&gt;
&lt;/table&gt;</summary>
		<author><name>Davidnewcomb</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Strip_Leading_Zeros&amp;diff=12182&amp;oldid=prev</id>
		<title>Davidnewcomb: Strip leading zeros</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Strip_Leading_Zeros&amp;diff=12182&amp;oldid=prev"/>
		<updated>2007-04-04T10:49:34Z</updated>

		<summary type="html">&lt;p&gt;Strip leading zeros&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Description ==&lt;br /&gt;
Strings with a leading zero are treated as octal. So stripping zeros using IntOp won&amp;#039;t work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
IntOp $v &amp;quot;00009&amp;quot; + 0&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
Name &amp;quot;TrimLeadingZeros&amp;quot;&lt;br /&gt;
OutFile &amp;quot;TrimLeadingZeros.exe&amp;quot;&lt;br /&gt;
ShowInstDetails show&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
var gen&lt;br /&gt;
&lt;br /&gt;
Function TrimLeadingZerosCall&lt;br /&gt;
&lt;br /&gt;
	Exch $R1&lt;br /&gt;
	Push $R2&lt;br /&gt;
Loop:&lt;br /&gt;
	StrCpy $R2 &amp;quot;$R1&amp;quot; 1&lt;br /&gt;
	StrCmp &amp;quot;$R2&amp;quot; &amp;quot;0&amp;quot; TrimLeft&lt;br /&gt;
	Goto Done&lt;br /&gt;
&lt;br /&gt;
TrimLeft:&lt;br /&gt;
	StrCpy $R1 &amp;quot;$R1&amp;quot; &amp;quot;&amp;quot; 1&lt;br /&gt;
	Goto Loop&lt;br /&gt;
&lt;br /&gt;
Done:&lt;br /&gt;
	StrCmp $R1 &amp;quot;&amp;quot; 0 +2&lt;br /&gt;
	StrCpy $R1 &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	Pop $R2&lt;br /&gt;
	Exch $R1&lt;br /&gt;
&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
!macro TrimLeadingZeros NUM&lt;br /&gt;
	Push ${NUM}&lt;br /&gt;
	Call TrimLeadingZerosCall&lt;br /&gt;
	Pop ${NUM}&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!define TrimLeadingZeros `!insertmacro TrimLeadingZeros`&lt;br /&gt;
&lt;br /&gt;
Section &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	StrCpy $gen &amp;quot;00009&amp;quot;&lt;br /&gt;
	${TrimLeadingZeros} $gen&lt;br /&gt;
	DetailPrint &amp;quot;Already applied: |$gen|&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	StrCpy $gen &amp;quot;00000&amp;quot;&lt;br /&gt;
	${TrimLeadingZeros} $gen&lt;br /&gt;
	DetailPrint &amp;quot;Already applied: |$gen|&amp;quot;&lt;br /&gt;
&lt;br /&gt;
SectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Output ==&lt;br /&gt;
&lt;br /&gt;
   Already applied: |9|&lt;br /&gt;
   Already applied: |0|&lt;br /&gt;
   Completed&lt;/div&gt;</summary>
		<author><name>Davidnewcomb</name></author>
	</entry>
</feed>