<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>isarray-function &#8211; MaxVergelli.com</title>
	<atom:link href="https://www.maxvergelli.com/tag/isarray-function/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.maxvergelli.com</link>
	<description>sourcecode repository</description>
	<lastBuildDate>Tue, 07 Apr 2020 13:42:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i2.wp.com/www.maxvergelli.com/wp-content/uploads/2020/04/wp-1586823685141.png?fit=32%2C32&#038;ssl=1</url>
	<title>isarray-function &#8211; MaxVergelli.com</title>
	<link>https://www.maxvergelli.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">34603511</site>	<item>
		<title>How to use Associative Arrays in ASP</title>
		<link>https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/</link>
					<comments>https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Sat, 01 Feb 2020 16:03:13 +0000</pubDate>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MS Access]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array-function]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[asp-associative-array]]></category>
		<category><![CDATA[associative-array]]></category>
		<category><![CDATA[classic-asp]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[data-layer]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[datetime-conversion]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[enumerating]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[helper-class]]></category>
		<category><![CDATA[isarray-function]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[wrapper-class]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=78</guid>

					<description><![CDATA[First of all, You need to download the &#8220;Asp Associative Array class&#8221; then include the file &#8220;AssociativeArrayClass.asp&#8221; in your asp page. Right now, You can start declaring associative arrays in ASP with the following syntax: [sourcecode language=&#8221;vb&#8221;] Dim Person Set &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/" aria-label="How to use Associative Arrays in ASP">Read More</a>]]></description>
										<content:encoded><![CDATA[<p>First of all, You need to download the <a href="http://sourceforge.net/projects/asp-assoc-array/">&#8220;Asp Associative Array class&#8221;</a> then include the file &#8220;AssociativeArrayClass.asp&#8221; in your asp page.</p>
<p>Right now, You can start declaring associative arrays in ASP with the following syntax:</p>
[sourcecode language=&#8221;vb&#8221;]
Dim Person<br />
Set Person = New AssociativeArray<br />
Person(&quot;name&quot;)    =   &quot;Max&quot;<br />
Person(&quot;surname&quot;) =   &quot;Vergelli&quot;<br />
Response.Write Person(&quot;name&quot;) &amp; &quot; &quot; &amp; Person(&quot;surname&quot;)<br />
[/sourcecode]
<p>In the above example, the key &#8220;name&#8221; in &#8220;Person&#8221; object, stores &#8220;Max&#8221; value. You can set strings or integers for the key and <strong>any object/variant type for the relative value</strong>. However, You can not set key with Null or &#8220;&#8221; strings like the following:</p>
[sourcecode language=&#8221;vb&#8221;]
&#8216;invalid keys&#8230;<br />
Person(Null) = &quot;Null Key&quot;<br />
Person(&quot;&quot;) = &quot;Empty String&quot;<br />
Dim undefined<br />
Person(undefined) = &quot;Variable Not Initialized&quot;<br />
Response.Write Person(&quot;&quot;) &amp; Person(Null) &amp; Person(undefined)<br />
[/sourcecode]
<p><strong>How to get every item of the associative array:</strong><br />
You can make a &#8220;For Each&#8221; loop on the array like in the following code</p>
[sourcecode language=&#8221;vb&#8221;]
For Each element In Person.Items<br />
   Response.Write element.Key &amp; &quot; : &quot; &amp; element.Value &amp; vbCrLf<br />
Next<br />
[/sourcecode]
<p>&#8220;Person.Items&#8221; gets all the items inside the associative array and for each item You can get &#8220;Key&#8221; and &#8220;Value&#8221; properties.</p>
<p><strong>How to copy an associative array:</strong></p>
[sourcecode language=&#8221;vb&#8221;]
Dim Person_Clone             &#8216;it&#8217;s a Variant type<br />
Set Person_Clone = Person    &#8216;NOTE: Use &quot;Set&quot; statement!<br />
&#8216;print values<br />
Response.Write Person_Clone(&quot;name&quot;) &amp; &quot; &quot; &amp; Person_Clone(&quot;surname&quot;) &amp; vbCrLf<br />
&#8216;get each key/value<br />
For Each element In Person_Clone.Items<br />
   Response.Write element.Key &amp; &quot; : &quot; &amp; element.Value &amp; vbCrLf<br />
Next<br />
[/sourcecode]
<p><strong>How to create nested associative arrays&#8230;</strong><br />
You can create infinite nested associative arrays and accessing them like the following:</p>
[sourcecode language=&#8221;vb&#8221;]
Dim Person<br />
Set Person = New AssociativeArray<br />
Person(&quot;name&quot;) = &quot;Max&quot;<br />
Person(&quot;surname&quot;) = &quot;Vergelli&quot;<br />
Dim People<br />
Set People = New AssociativeArray<br />
People(1) = Person<br />
People(2) = Person<br />
People(3) = Person<br />
Response.Write People(1)(&quot;name&quot;) &amp; &quot; &quot; &amp; People(1)(&quot;surname&quot;)<br />
[/sourcecode]
<p>Besides, You can enumerate all the keys/values inside the &#8220;People&#8221; associative array object</p>
[sourcecode language=&#8221;vb&#8221;]
For Each element In People.Items<br />
   Dim el_person<br />
   Set el_person = element.Value<br />
   Response.Write el_person(&quot;name&quot;) &amp; &quot; : &quot; &amp; el_person(&quot;surname&quot;) &amp; vbCrLf<br />
Next<br />
[/sourcecode]
]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">78</post-id>	</item>
		<item>
		<title>Javascript isArray() function</title>
		<link>https://www.maxvergelli.com/javascript-isarray-function/</link>
					<comments>https://www.maxvergelli.com/javascript-isarray-function/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Fri, 01 Nov 2019 14:50:42 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array-function]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[datatype]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[isarray-function]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[typeof]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=55</guid>

					<description><![CDATA[Javascript does not provide a function to recognize if a variable is an array or not; you can make a &#8220;typeof&#8221; of the variable however u&#8217;ll get an &#8216;object&#8217; datatype, as in the following code [sourcecode language=&#8221;javascript&#8221;] var myarray = &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/javascript-isarray-function/" aria-label="Javascript isArray() function">Read More</a>]]></description>
										<content:encoded><![CDATA[<p>Javascript does not provide a function to recognize if a variable is an array or not; you can make a &#8220;typeof&#8221; of the variable however u&#8217;ll get an &#8216;object&#8217; datatype, as in the following code<br />
[sourcecode language=&#8221;javascript&#8221;]
var myarray = [1, 2, 3];<br />
var myobject = { key: &#8216;value&#8217; };<br />
alert(typeof myarray); //return &#8216;object&#8217;<br />
alert(typeof myobject); //return &#8216;object&#8217;<br />
[/sourcecode]
<p>to recognize a data type &#8216;object&#8217; from &#8216;array&#8217;, you need a specialized function like this&#8230;<br />
[sourcecode language=&#8221;javascript&#8221;]
function isArray(value){<br />
	var b = typeof value;<br />
	if(b === &#8216;object&#8217;){<br />
		if(value){<br />
			b = (typeof value.length === &#8216;number&#8217; &amp;&amp;<br />
				!(value.propertyIsEnumerable(&#8216;length&#8217;)) &amp;&amp;<br />
				typeof value.splice === &#8216;function&#8217;) ? true : false;<br />
		}else{<br />
			b = false;<br />
		};<br />
	};<br />
	return b;<br />
};<br />
var myarray = [1, 2, 3];<br />
var myobject = { key: &#8216;value&#8217; };<br />
alert(isArray(myarray)); //return true<br />
alert(isArray(myobject)); //return false<br />
[/sourcecode]
<p>Good work!<br />
Max 🙂</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/javascript-isarray-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">55</post-id>	</item>
	</channel>
</rss>
