<?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/"
	>

<channel>
	<title>Art Of Creation - Dynamics AX Blog &#187; Data Types</title>
	<atom:link href="http://www.artofcreation.be/tag/data-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artofcreation.be</link>
	<description>The everyday life of a Dynamics AX developer</description>
	<lastBuildDate>Thu, 02 Feb 2012 12:20:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Str2int and IsInteger</title>
		<link>http://www.artofcreation.be/2010/02/04/str2int-and-isinteger/</link>
		<comments>http://www.artofcreation.be/2010/02/04/str2int-and-isinteger/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 11:16:50 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Data Types]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=439</guid>
		<description><![CDATA[Here&#8217;s a little &#8216;be-aware&#8217; I&#8217;d like to share. The function str2int() that converts a string to an integer will return &#8217;0&#8242; if the input string is not an integer, so it is necessary to check if the string is an integer before casting it. The function that does this is not IsNumeric() like in SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little &#8216;be-aware&#8217; I&#8217;d like to share.</p>
<p>The function str2int() that converts a string to an integer <strong>will return &#8217;0&#8242; if the input string is not an integer</strong>, so it is necessary to check if the string is an integer before casting it.</p>
<p>The function that does this is not IsNumeric() like in SQL or VB, but IsInteger().<br />
Alternatively, you can also use str2IntOk(). Both are found in the global class.</p>
<p>I&#8217;ve seen people searching for this method (including me), so I just thought I&#8217;d share.</p>
<p>Here&#8217;s some sample code:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> klforStr2intAndIsIntegerTest<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> input_notint &nbsp; &nbsp;<span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;abc123&quot;</span>;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> input_int &nbsp; &nbsp; &nbsp; <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;123&quot;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> ret;<br />
&nbsp; &nbsp; ;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #007f00;">// be aware, str2int will convert 'non integers' to '0'</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// without warning</span><br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;%1&quot;</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">str2int</span><span style="color: #000000;">&#40;</span>input_notint<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;%1&quot;</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">str2int</span><span style="color: #000000;">&#40;</span>input_int<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #007f00;">// you can check if a string is an integer with </span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// the isInteger() function from the global class</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// or you the str2IntOk() function</span><br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;%1&quot;</span><span style="color: #00007f;">,</span> isInteger<span style="color: #000000;">&#40;</span>input_notint<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;%1&quot;</span><span style="color: #00007f;">,</span> isInteger<span style="color: #000000;">&#40;</span>input_int<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #007f00;">// check if integer</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>isInteger<span style="color: #000000;">&#40;</span>input_notint<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// cast to integer</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ret <span style="color: #00007f;">=</span> <span style="color: #0000ff;">str2int</span><span style="color: #000000;">&#40;</span>input_notint<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">throw</span> error<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;'%1' is not an integer&quot;</span><span style="color: #00007f;">,</span> input_notint<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/02/04/str2int-and-isinteger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Remove leading zeros</title>
		<link>http://www.artofcreation.be/2009/08/03/remove-leading-zeros/</link>
		<comments>http://www.artofcreation.be/2009/08/03/remove-leading-zeros/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 08:49:55 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Data Types]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=147</guid>
		<description><![CDATA[Sometimes, you&#8217;ll want to add leading zeros, but other times, you&#8217;ll have to remove leading zeros from a string. Here the code that does just that: static void RemoveLeadingZeros&#40;Args _args&#41; &#123; &#160; &#160; str text = &#34;0000A1337&#34;; &#160; &#160; ; &#160; &#160; while&#40;substr&#40;text, 1, 1&#41; == &#34;0&#34;&#41; &#160; &#160; &#123; &#160; &#160; &#160; &#160; text [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, you&#8217;ll want to <a href="http://www.doens.be/2009/07/add-leading-zeros/">add leading zeros</a>, but other times, you&#8217;ll have to remove leading zeros from a string.<br />
Here the code that does just that:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> RemoveLeadingZeros<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> text <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;0000A1337&quot;</span>;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>text<span style="color: #00007f;">,</span> <span style="color: #000000;">1</span><span style="color: #00007f;">,</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #00007f;">==</span> <span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; text <span style="color: #00007f;">=</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>text<span style="color: #00007f;">,</span> <span style="color: #000000;">2</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">strlen</span><span style="color: #000000;">&#40;</span>text<span style="color: #000000;">&#41;</span> <span style="color: #00007f;">-</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span>text<span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>The above example will work for any alphanumeric string.</p>
<p>When you&#8217;re sure you&#8217;re dealing with numeric strings, you can use this example:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> RemoveLeadingZeros2<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> text <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;00001337&quot;</span>;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strrem</span><span style="color: #000000;">&#40;</span>text<span style="color: #00007f;">,</span> <span style="color: #ff0000;">&quot;0123456789&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #00007f;">==</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; info<span style="color: #000000;">&#40;</span>int2str<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">str2int</span><span style="color: #000000;">&#40;</span>text<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; error<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;text is not numeric&quot;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>You should build in a check because <strong>the str2int() function doesn&#8217;t throw an error when the input isn&#8217;t numeric</strong>. </p>
<p>An example I found online also removes leading zeros from a string, but it fails if the first character after the zeros isn&#8217;t numeric:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> RemoveLeadingZeros3<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> text <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;0000A1337&quot;</span>; <span style="color: #007f00;">// doesnt work</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// str text = &quot;00001A337&quot;; // works</span><br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strdel</span><span style="color: #000000;">&#40;</span>text<span style="color: #00007f;">,</span> <span style="color: #000000;">1</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">strfind</span><span style="color: #000000;">&#40;</span>text<span style="color: #00007f;">,</span> <span style="color: #ff0000;">&quot;123456789&quot;</span><span style="color: #00007f;">,</span> <span style="color: #000000;">1</span><span style="color: #00007f;">,</span> <span style="color: #0000ff;">strlen</span><span style="color: #000000;">&#40;</span>text<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #00007f;">-</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Conclusion:<br />
The first example works best, but you should still be careful when converting the resulting string to other types, as you could get unexpected results. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2009/08/03/remove-leading-zeros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wrong argument types in variable assignment &#8211; Part 2</title>
		<link>http://www.artofcreation.be/2009/04/07/wrong-argument-types-in-variable-assignment-part-2/</link>
		<comments>http://www.artofcreation.be/2009/04/07/wrong-argument-types-in-variable-assignment-part-2/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 20:04:00 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Data Types]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=36</guid>
		<description><![CDATA[In the article Wrong argument types in variable assignment, I wrote about how you can solve this error by using compile forward, but doing that won&#8217;t always fix the problem, e.g. when using AnyType. Anytype is great. It&#8217;s a primitive data type can use as a placeholder for any other data type, and comes in [...]]]></description>
			<content:encoded><![CDATA[<p>In the article <a href="http://www.artofcreation.be/2009/04/04/wrong-argument-types-in-variable-assignment/">Wrong argument types in variable assignment</a>, I wrote about how you can solve this error by using compile forward, but doing that won&#8217;t always fix the problem, e.g. when using AnyType.</p>
<p><em>Anytype</em> is great. It&#8217;s a primitive data type can use as a placeholder for any other data type, and comes in handy on many occasions. But don&#8217;t use it as a silver bullet, it might backfire.</p>
<p>Consider the next example.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> AnyType_Test_1<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; utcDateTime dateTime;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">AnyType</span> &nbsp; &nbsp; value;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; value <span style="color: #00007f;">=</span> datetimeutil<span style="color: #00007f;">::</span><span style="color: #000000;">utcNow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; dateTime <span style="color: #00007f;">=</span> value;<br />
<br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strFmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;%1&quot;</span><span style="color: #00007f;">,</span> dateTime<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>We are assigning the current date and time to the AnyType variable, than back to a utcDateTime, and sending it to te screen. This neatly produces following output:</p>
<blockquote><p>7/04/2009 19:27:15</p></blockquote>
<p>Now consider the following example.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> AnyType_Test_2<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; utcDateTime dateTime;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">AnyType</span> &nbsp; &nbsp; value;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; value <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;Here comes today's date&quot;</span>;<br />
<br />
&nbsp; &nbsp; value <span style="color: #00007f;">=</span> datetimeutil<span style="color: #00007f;">::</span><span style="color: #000000;">utcNow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; dateTime <span style="color: #00007f;">=</span> value;<br />
<br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strFmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;%1&quot;</span><span style="color: #00007f;">,</span> dateTime<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>This produces the following output:</p>
<blockquote><p>&nbsp;</p></blockquote>
<p>Yes, that&#8217;s a blank line. Weird, isn&#8217;t it, or is it? <a href="http://msdn.microsoft.com/en-us/library/aa853001.aspx">MSDN </a>has the answer:</p>
<blockquote><p>The anytype data types can be automatically converted to dates, enums, integers, reals, strings, guids, int64s, extended data types (records), classes, and containers by assigning a value to the type. [...] However, after you have converted the anytype data type, you cannot then change it to another data type. </p></blockquote>
<p>In the second example it failed to convert the utcDateTime because we assigned a string to the AnyType variable. This is fault very subtle, because no error or warning is shown when compiling such code, and can easily be overlooked. </p>
<p>Not only can (incorrect) use of AnyType cause faulty output, it can also trigger stack traces.<br />
The following example is <a href="http://gregondax.wordpress.com/2009/02/06/one-thing-you-should-know-about-the-x-type-anytype/">inspired by Greg</a>.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> AnyType_Test_3<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">AnyType</span> &nbsp; &nbsp; value;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; value <span style="color: #00007f;">=</span> NoYes<span style="color: #00007f;">::</span><span style="color: #000000;">Yes</span>;<br />
&nbsp; &nbsp; value <span style="color: #00007f;">=</span> datetimeutil<span style="color: #00007f;">::</span><span style="color: #000000;">utcNow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>This will show the following error message and stack trace:</p>
<blockquote><p>Error executing code: Wrong argument types in variable assignment.</p></blockquote>
<p>It gets even nastier in the next example:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> AnyType_Test_4<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; utcDateTime dt;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">AnyType</span> value <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;string&quot;</span>;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; value <span style="color: #00007f;">=</span> <span style="color: #000000;">3</span>;<br />
&nbsp; &nbsp; dt <span style="color: #00007f;">=</span> value;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>This will show you a message box saying:</p>
<blockquote><p>Internal error number 25 in script.</p></blockquote>
<blockquote><p><em>Note: if you are looking to solve the error above (you can encounter it when trying to send an email from code), you can find the links to the hotfixes for ax 2009 <a href="http://www.doens.be/2009/08/internal-error-number-25-in-script-occurs/">here</a>.</em></p></blockquote>
<p>And also the error and stack trace we saw before: </p>
<blockquote><p>Error executing code: Wrong argument types in variable assignment.</p></blockquote>
<p>Conclusion: Use AnyType with caution, preferably as argument or return type, and remember that the type can not be change once it has been assigned a value. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2009/04/07/wrong-argument-types-in-variable-assignment-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

