<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://script.quakenet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=%24instok</id>
	<title>$instok - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://script.quakenet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=%24instok"/>
	<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$instok&amp;action=history"/>
	<updated>2026-05-14T23:52:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$instok&amp;diff=4290&amp;oldid=prev</id>
		<title>Doomie: deleted comma</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$instok&amp;diff=4290&amp;oldid=prev"/>
		<updated>2005-11-15T19:59:53Z</updated>

		<summary type="html">&lt;p&gt;deleted comma&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 19:59, 15 November 2005&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-l10&quot;&gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&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;br&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;br&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;The following example is a little bit more complex. It&amp;#039;s about adding a number in a string in the correct position (e.g. sorting (insertsort))&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;The following example is a little bit more complex. It&amp;#039;s about adding a number in a string in the correct position (e.g. sorting (insertsort))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   var %mynumbers = 1,4,8,34,77,111,876&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/del&gt;&lt;/div&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;   var %mynumbers = 1,4,8,34,77,111,876&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;   var %mynewnumber = 77&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;   var %mynewnumber = 77&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;   ; set %numbers to the count of numbers in %mynumbers&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;   ; set %numbers to the count of numbers in %mynumbers&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Doomie</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$instok&amp;diff=921&amp;oldid=prev</id>
		<title>Doomie at 19:55, 15 November 2005</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$instok&amp;diff=921&amp;oldid=prev"/>
		<updated>2005-11-15T19:55:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Inserts token into the Nth position in text, even if it already exists in text.&lt;br /&gt;
 $instok(text,token,N,C)&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; that you can specify a negative value for N.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 [[var]] %mytext This is my text&lt;br /&gt;
 var %mynewtext = $instok(%mytext, new, 4, 32)&lt;br /&gt;
 [[echo]] -a %mynewtext &lt;br /&gt;
This example would return &amp;#039;&amp;#039;This is my new text&amp;#039;&amp;#039;, as &amp;#039;&amp;#039;new&amp;#039;&amp;#039; was inserted in the 4th position.&lt;br /&gt;
&lt;br /&gt;
The following example is a little bit more complex. It&amp;#039;s about adding a number in a string in the correct position (e.g. sorting (insertsort))&lt;br /&gt;
  var %mynumbers = 1,4,8,34,77,111,876,&lt;br /&gt;
  var %mynewnumber = 77&lt;br /&gt;
  ; set %numbers to the count of numbers in %mynumbers&lt;br /&gt;
  var %i = 1, %numbers = $numtok(%mynumbers,44)&lt;br /&gt;
  [[while]] (%i &amp;lt;= %numbers) {&lt;br /&gt;
    ; check if the number at position %i is bigger than %mynewnumber&lt;br /&gt;
    [[if]] ([[$gettok]](%mynumbers,%i,44) &amp;gt; %mynewnumber) {&lt;br /&gt;
      ; it is bigger, so put it at this position&lt;br /&gt;
      var %mynumbers = $instok(%mynumbers,%mynewnumber, %i, 44)&lt;br /&gt;
      ; stop the while loop, as we are done.&lt;br /&gt;
      [[break]]&lt;br /&gt;
    }&lt;br /&gt;
    [[inc]] %i&lt;br /&gt;
    ; if we are at the end, the number is obviously not inserted. Put it at the end, as it is bigger than every other.&lt;br /&gt;
    if (%i == %numbers) {&lt;br /&gt;
      var %mynumbers = $instok(%mynumbers,%mynewnumber, $calc(%i + 1), 44)&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  ; echo the new string&lt;br /&gt;
  echo -a %mynumbers&lt;br /&gt;
[[Category:Token Identifiers]]&lt;/div&gt;</summary>
		<author><name>Doomie</name></author>
	</entry>
</feed>