<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Sasha Nazarov's Remarks</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/feed.xml</link>
    <description>about Microsoft Dynamics AX development</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:05:37 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Moving on</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/moving-on</link>
      <pubDate>Mon, 30 Apr 2012 07:55:59 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2012/04/30/moving-on/</guid>
      <description><![CDATA[Hi all,
I am about to leave MS, and this blog will be frozen.
You are more than welcome to visit...]]></description>
      <content:encoded><![CDATA[<p>Hi all,</p>
<p>I am about to leave MS, and this blog will be frozen.</p>
<p>You are more than welcome to visit my new blog, dedicated to Dynamics AX: <a href="http://sashanazarov.blogspot.com">http://sashanazarov.blogspot.com</a></p>
<p>I hope that the new blog will benefit from me being closer to our clients.</p>
<p>Cheers,<br />Sasha</p>]]></content:encoded>
    </item>
    <item>
      <title>Remember to test performance!</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/remember-to-test-performance</link>
      <pubDate>Mon, 22 Mar 2010 03:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2010/03/22/remember-to-test-performance/</guid>
      <description><![CDATA[When you write new code, and the execution time of this code is dependant on the number of records...]]></description>
      <content:encoded><![CDATA[<P>When you write new code, and the execution time of this code is dependant on the number of records to process, you must ensure that the time grows proportionally to the number of the records. In many cases, it is not obvious how slow some algorithm is on large sets of input data.</P>
<P>This is an example of the X++ job.&nbsp;You&nbsp;can use it&nbsp;to understand how well your algorithm does from the performance point of view.</P>
<P mce_keep="true">static void testPerformance_Job(Args _args)<BR>{<BR>&nbsp;&nbsp;&nbsp; #define.Limit(128)<BR>&nbsp;&nbsp;&nbsp; #define.ExecutionTime(1)<BR>&nbsp;&nbsp;&nbsp; int elements;<BR>&nbsp;&nbsp;&nbsp; int time;</P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp; void doSomething_LinearTime(int _elements)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep(_elements * #ExecutionTime);<BR>&nbsp;&nbsp;&nbsp; }</P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp; void doSomething_QuadraticTime(int _elements)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep((_elements * #ExecutionTime) * (_elements * #ExecutionTime));<BR>&nbsp;&nbsp;&nbsp; }</P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp; elements = 1;<BR>&nbsp;&nbsp;&nbsp; while (elements &lt;= #Limit)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time = WinAPI::getTickCount();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doSomething_LinearTime(elements);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //doSomething_QuadraticTime(elements);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time = WinAPI::getTickCount() - time;</P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; info(strFmt("Elements %1, time %2 ms, %3 elements/ms", <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elements, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time == 0 ? 0 : elements / time));</P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elements = elements * 2;<BR>&nbsp;&nbsp;&nbsp; }<BR>}</P>
<P mce_keep="true">The idea is pretty simple: you increase complexity in a fast manner&nbsp;and check how many elements get processed per millisecond. The job above results in the following:</P>
<P mce_keep="true">Elements 1, time 0 ms, 0 elements/ms<BR>Elements 2, time 0 ms, 0 elements/ms<BR>Elements 4, time 0 ms, 0 elements/ms<BR>Elements 8, time 16 ms, 0,50 elements/ms<BR>Elements 16, time 15 ms, 1,07 elements/ms<BR>Elements 32, time 31 ms, 1,03 elements/ms<BR>Elements 64, time 78 ms, 0,82 elements/ms<BR>Elements 128, time 125 ms, 1,02 elements/ms</P>
<P mce_keep="true">So, the "complexity-to-time" function is linear (ignore the lines with&nbsp;zero execution time). Cool.&nbsp;Now, let's check another method's performance:</P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //doSomething_LinearTime(elements);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doSomething_QuadraticTime(elements);&nbsp;</P>
<P mce_keep="true">The following&nbsp;execution log is printed:&nbsp;</P>
<P mce_keep="true">Elements 1, time 0 ms, 0 elements/ms<BR>Elements 2, time 0 ms, 0 elements/ms<BR>Elements 4, time 16 ms, 0,25 elements/ms<BR>Elements 8, time 62 ms, 0,13 elements/ms<BR>Elements 16, time 265 ms, 0,06 elements/ms<BR>Elements 32, time 1030 ms, 0,03 elements/ms<BR>Elements 64, time 4087 ms, 0,02 elements/ms<BR>Elements 128, time 16380 ms, 0,01 elements/ms</P>
<P mce_keep="true">Here, the number of processed elements per millisecond drops.&nbsp;Imagine how&nbsp;many years&nbsp;it would take to process 1.000.000 elements with this bad performance? About 32.000 years. And&nbsp;for the first, linear algorithm, it would take only 12 days.</P>
<P mce_keep="true">So, whenever you are in doubt about how&nbsp;fast your algorithm&nbsp;is when number of elements to process is growing, write this kind of job. It will immediately reveal problems with the performance.</P>]]></content:encoded>
    </item>
    <item>
      <title>Relational operator 'like'</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/relational-operator-like</link>
      <pubDate>Wed, 20 Aug 2008 07:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2008/08/20/relational-operator-like/</guid>
      <description><![CDATA[After having 5+ years of X++ experience, I finally&nbsp;realized that the relational operator 'like'...]]></description>
      <content:encoded><![CDATA[<P>After having 5+ years of X++ experience, I finally&nbsp;realized that the relational operator 'like' might equally well be used outside of select-statements,&nbsp;just&nbsp;like this:</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3>static void testLike(Args _args)<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3>{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>str someString;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>someString = "Johnny";<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>if (someString like "Joh?ny" || someString like "*ny")<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>info("Dammit, I should have known this before!");<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3>}</FONT></SPAN></o:p></P></TD></TR></TBODY></TABLE></P>
<P>It looks very much like I don't need <EM>Global::strStartsWith()</EM> and <EM>Global::strEndsWith()</EM> methods anymore...</P>]]></content:encoded>
    </item>
    <item>
      <title>QuickSort</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/quicksort</link>
      <pubDate>Tue, 20 May 2008 07:54:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2008/05/20/quicksort/</guid>
      <description><![CDATA[I have just written a&nbsp;simple class that implements QuickSort algorithm and allows sorting of...]]></description>
      <content:encoded><![CDATA[<P>I have just written a&nbsp;simple class that implements QuickSort algorithm and allows sorting of some "keys" by their "values". </P>
<P>And this is how it may be used:</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.65in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=638>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>static void exampleQuickSort(Args _args)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>QuickSort<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>quickSort;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ListEnumerator<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>itemEnumerator;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>str<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>itemId;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Qty<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>qty;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>quickSort = QuickSort::construct(Types::String, Types::Real);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>quickSort.add('Item1', 10.00);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>quickSort.add('Item2', 12.00);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>quickSort.add('Item3',<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>9.00);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>itemEnumerator = quickSort.getEnumerator();<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (itemEnumerator.moveNext())<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[itemId, qty] = itemEnumerator.current();<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>print itemId, ' ', qty;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>pause;<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-FAMILY: Consolas"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE></P>
<P>The output will look like this:</P>
<P>Item3 9,00<BR>Item1 10,00<BR>Item2 12,00</P>
<P>You may find the class in the attachment.</P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/08/52/26/57/Class_QuickSort.xpo" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-08-52-26-57/Class_5F00_QuickSort.xpo">Class_QuickSort.xpo</a></p>]]></content:encoded>
    </item>
    <item>
      <title>By the way...</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/by-the-way</link>
      <pubDate>Fri, 02 May 2008 03:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2008/05/02/by-the-way/</guid>
      <description><![CDATA[...the class that I mentioned in my previous post has been implemented in&nbsp;Dynamics AX...]]></description>
      <content:encoded><![CDATA[<P>...the class that I mentioned in my previous post has been implemented in&nbsp;Dynamics AX 2009&nbsp;as SysFormEnumComboBox. </P>
<P>Be aware, that Vanya Kashperuk has <A class="" href="http://kashperuk.blogspot.com/2008/04/sysformenumcombobox-class-allowing-to.html" target=_blank mce_href="http://kashperuk.blogspot.com/2008/04/sysformenumcombobox-class-allowing-to.html">published</A> another version of this class, valid for both 4.0 and 2009.</P>]]></content:encoded>
    </item>
    <item>
      <title>How to exclude some enum values from a combobox?</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/how-to-exclude-some-enum-values-from-a-combobox</link>
      <pubDate>Thu, 04 Oct 2007 08:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2007/10/04/how-to-exclude-some-enum-values-from-a-combobox/</guid>
      <description><![CDATA[Imagine a combobox based on an enum. By default it contains a list of items that correspond to the...]]></description>
      <content:encoded><![CDATA[<P>Imagine a combobox based on an enum. By default it contains a list of items that correspond to the values of the enum.</P>
<P>Quite often&nbsp;people wonder whether there is a simple way to limit this list to a set of allowed values. Maybe there is a solution posted somewhere&nbsp;in the net&nbsp;- please let me know if you&nbsp;met one. As I has not found&nbsp;anything like that, I propose the following.</P>
<P>1. Create a class, named, say, SysCustomizedEnumComboBox. In the class declaration, write:</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">class SysCustomizedEnumComboBox<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>FormRun<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>formRun;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>int<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>comboBoxControlId;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>EnumId<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>enumId;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>Set<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>allowedEnumValuesSet;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p></o:p></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>Map<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>enumValue2ComboBoxItemMap;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>SysDictEnum sysDictEnum;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE></P>
<P>2. Create parm-methods for each of the first 4 variables, and a constructor method without input parameters.</P>
<P>3. Now, create init() method (thanks to&nbsp;<A class="" href="http://blogs.msdn.com/palle_agermark/archive/2005/06/30/434146.aspx" target=_blank mce_href="http://blogs.msdn.com/palle_agermark/archive/2005/06/30/434146.aspx">Palle Agermark</A>&nbsp;who proposed a way to build comboboxes at run-time):</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">protected void init()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>#define.List(1)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>FormComboBoxControl formComboBoxControl;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>SetEnumerator<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>allowedEnumValueEnumerator;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>int<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>comboBoxItemNumber;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>int<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>allowedEnumValue;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>sysDictEnum = new SysDictEnum(enumId);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl = formRun.form().design().control(comboBoxControlId);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.enumType(0); // don't assign any enum type<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.label(sysDictEnum.label());<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.helpText(sysDictEnum.help());<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.comboType(#List);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.items(allowedEnumValuesSet.elements());<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>enumValue2ComboBoxItemMap = new Map(Types::Integer, Types::Integer);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>comboBoxItemNumber = 1;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>allowedEnumValueEnumerator = allowedEnumValuesSet.getEnumerator();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>while (allowedEnumValueEnumerator.moveNext())<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>allowedEnumValue = allowedEnumValueEnumerator.current();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.item(comboBoxItemNumber);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.text(sysDictEnum.value2Name(allowedEnumValue));<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>enumValue2ComboBoxItemMap.insert(allowedEnumValue, comboBoxItemNumber);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>comboBoxItemNumber++;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE></P>
<P>4. Create a method that will construct the class and initialize it:</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">public static SysCustomizedEnumComboBox newParameters(<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>FormRun _formRun,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>int<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;</SPAN>_comboBoxControlId,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>EnumId<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>_enumId,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>Set<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_allowedEnumValuesSet)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>SysCustomizedEnumComboBox sysCustomizedEnumComboBox =</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; SysCustomizedEnumComboBox::construct();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>sysCustomizedEnumComboBox.parmFormRun(_formRun);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>sysCustomizedEnumComboBox.parmComboBoxControlId(_comboBoxControlId);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>sysCustomizedEnumComboBox.parmEnumId(_enumId);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>sysCustomizedEnumComboBox.parmAllowedEnumValuesSet(_allowedEnumValuesSet);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>sysCustomizedEnumComboBox.init();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>return sysCustomizedEnumComboBox;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE></P>
<P>5. And finally, add a couple of methods that will manipulate the combobox:</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">public void select(int _enumValue)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>FormComboBoxControl formComboBoxControl;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>if (!enumValue2ComboBoxItemMap.exists(_enumValue))<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>throw error(Error::wrongUseOfFunction(funcName()));<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl = formRun.control(comboBoxControlId);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl.selection(enumValue2ComboBoxItemMap.lookup(_enumValue) - 1);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE></P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">public int selection()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>FormComboBoxControl formComboBoxControl;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>int<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ret;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>formComboBoxControl = formRun.control(comboBoxControlId);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>ret = sysDictEnum.name2Value(</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; formComboBoxControl.getText(formComboBoxControl.selection()));<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>return ret;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE></P>
<P mce_keep="true">6. That's it.</P>
<P mce_keep="true">Now, you may use the class in a form. For example, you have a form named ReserveTickets. It is used for booking airplain tickets for employees. There are&nbsp;2 classes that represent employees and managers, and Manager class extends Employee. The booking form may be called by either of the classes. Depending on what class is the caller, the types of the tickets are different, so that employees may book only economy seats, while managers - economy and business seats. Let's say we have an enum SeatType representing both seat types.</P>
<P mce_keep="true">So, first of all we have to add a method to Employee class, and override it in the sub-class:</P>
<P mce_keep="true">
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">// Employee class method&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">public Set allowedSeatTypeValuesSet()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; Set allowedSeatTypeValuesSet;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>allowedSeatTypeValuesSet = new Set(Types::Enum);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp; allowedSeatTypeValuesSet.add(SeatType::Economy);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>return allowedSeatTypeValuesSet;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE></P>
<P mce_keep="true">
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">// Manager class method&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">public Set allowedSeatTypeValuesSet()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; Set allowedSeatTypeValuesSet;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>allowedSeatTypeValuesSet = super();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp; allowedSeatTypeValuesSet.add(SeatType::Business);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>return allowedSeatTypeValuesSet;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></SPAN></TD></TR></TBODY></TABLE></P>
<P>And finally, let's correct the form ReserveTickets (assuming that it&nbsp;has a combobox&nbsp;named SeatTypeComboBox). Declare sysCustomizedEnumComboBox member-variable in the form class declaration. Then override init() method of the form as follows:</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 6.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=667 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.95in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=667><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">public void&nbsp;init()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">{</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; Employee&nbsp;&nbsp; caller = this.args().caller();</SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp; sysCustomizedEnumComboBox = SysCustomizedEnumComboBox::newParameters(</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; element,</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;control::SeatTypeComboBox,</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enumNum(SeatType),</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; caller.allowedSeatTypeValuesSet());</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">&nbsp;&nbsp;&nbsp; super();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas"><o:p>&nbsp;</o:p></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas">}</SPAN><o:p></o:p></P></SPAN></TD></TR></TBODY></TABLE></P>
<P>Done. From now on, whenever this form is called by Employee class - only economy tickets will be selectable, and when called by Manager - then both economy and business tickets will.</P>
<P>We don't actually use select() and selection() methods of SysCustomizedEnumComboBox in this form example. These methods would become handy if there was another class behind the form, and the form was used as a user interface for this class member-variable SeatType. I don't provide the example here, but I know - you understand the concept.</P>]]></content:encoded>
    </item>
    <item>
      <title>Looking for help documentation</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/looking-for-help-documentation</link>
      <pubDate>Thu, 21 Jun 2007 08:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2007/06/21/looking-for-help-documentation/</guid>
      <description><![CDATA[There is a simple way to programmatically fetch help documentation for system functions based on...]]></description>
      <content:encoded><![CDATA[<P>There is a simple way to programmatically fetch help documentation for system functions based on what text is stored in the xpo-files.<BR>If you run this:<BR>-----------------------------------------------<BR>static void getSystemDocumentation_Job(Args _args)<BR>{<BR>&nbsp;&nbsp;&nbsp; ;<BR>&nbsp;&nbsp;&nbsp; info(Web::stripHTML(TreeNode::findNode(@"\System Documentation\Functions\abs").AOTgetSource(), true, true));<BR>}<BR>-----------------------------------------------<BR>then an infolog will appear:<BR>-----------------------------------------------<BR>Information:</P>
<P>Abs <BR>&nbsp;[HEADER]</P>
<P><BR>Returns the absolute value of arg. </P>
<P>Examples <BR>Abs(-100.0) returns the value '100.0'. </P>
<P>Abs(30.56) returns the value '30.56'. <BR>static void Job_Examples_22885_1_abs(Args _args)<BR>{<BR>&nbsp; real r1;<BR>&nbsp; real r2;<BR>&nbsp; ;</P>
<P>&nbsp; r1 = abs(-3.14);<BR>&nbsp; r2 = abs(3.14);<BR>&nbsp; if (r1 == r2)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; print "abs of values are the same";<BR>&nbsp;&nbsp;&nbsp; pause;<BR>&nbsp; }<BR>}</P>
<P>-----------------------------------------------</P>
<P>Unfortunately, special symbols like ‘&gt;’ are converted to something like ‘&amp;lt’, but still this is a way to understand what the kernel function does.</P>]]></content:encoded>
    </item>
    <item>
      <title>The way to read weighty books</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/the-way-to-read-weighty-books</link>
      <pubDate>Mon, 04 Jun 2007 06:37:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2007/06/04/the-way-to-read-weighty-books/</guid>
      <description><![CDATA[I am&nbsp;a lazy guy. And some time ago it was very difficult for me to brace up and read a good...]]></description>
      <content:encoded><![CDATA[<P>I am&nbsp;a lazy guy. And some time ago it was very difficult for me to brace up and read a good thick technical book from cover to cover. <BR>For example, "<A class="" href="http://www.amazon.com/Code-Complete-Second-Steve-McConnell/dp/0735619670/ref=pd_bbs_1/104-1898452-2588767?ie=UTF8&amp;s=books&amp;qid=1180946820&amp;sr=8-1" target=_blank mce_href="http://www.amazon.com/Code-Complete-Second-Steve-McConnell/dp/0735619670/ref=pd_bbs_1/104-1898452-2588767?ie=UTF8&amp;s=books&amp;qid=1180946820&amp;sr=8-1">Code Complete, 2nd Edition</A>" is 960 pages thick. I knew, that this one was a "must read" for every developer. I had been trying to&nbsp;read it&nbsp;for a year or something. But its thickness was awesome. And each time I thought "well, I'll better continue tomorrow....". And the "tomorrow" came rather seldom. </P>
<P>But the day has come, when I found a way to fix this problem -&nbsp;Microsoft Office Project. So, I&nbsp;took "Code Complete" and split the remaining 660 pages into 33 groups of 20 pages each, and then I assigned a business day to each of the groups. According to the plan, I should have read the rest of the book in about 1,5 months. The last day has become tangible - I knew the exact date, when the book would be read. More then that, I promised myself, that I would burn a 100 DKK bill (about 20 USD) whenever I spend an evening without reading the planned 20 pages. The plan was printed and put onto the wall. I&nbsp;crossed&nbsp;one small blue "task" rectangle&nbsp;with a&nbsp;green marker every&nbsp;time I&nbsp;was done with another bunch of pages.</P>
<P>And, you know, I have burnt no money. Instead, the Day has come, when I&nbsp;read the last sentense and closed the book. I can't describe what I felt at the moment. It was a mixture of two feelings -&nbsp;impression by the book and impression by the fact. The plan has done its job, and I have become a better developer!</P>
<P>Several other books have been read since then, mostly recommended by Steve McConnell&nbsp;for a developer "reading plan". Each book was split and planned. 20 pages a day. Very little daily effort, but huge yearly improvement.&nbsp;It is not&nbsp;a big deal to read 2 books in parallel, 20+20 pages a day, but one book is still fine. </P>
<P>The funny thing is, that my wife has also decided to use this approach while preparing for her last Danish exam: she is reading 2 pages of grammar and processes 2 pages of exercises, every day. She did not promise to herself that she would burn anything if the plan is not followed, still she follows it since the beginning. Our plans hang on the wall - side by side. </P>
<P>There is&nbsp;definitely a sort of magic in a printed&nbsp;Gannt chart. No doubt about that. Try it out.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//olenaz/3076397.aspx" original-url="http://blogs.msdn.com/photos/olenaz/picture3076397.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/03/07/63/97/plan_small.bmp" original-url="http://blogs.msdn.com/photos/olenaz/images/3076397/thumb.aspx" border=0></A></P>]]></content:encoded>
    </item>
    <item>
      <title>Import of dimension set rules</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/import-of-dimension-set-rules</link>
      <pubDate>Mon, 05 Mar 2007 14:05:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2007/03/05/import-of-dimension-set-rules/</guid>
      <description><![CDATA[A&nbsp;couple of days ago I had a question. One guy had to generate dimension set rules for ledger...]]></description>
      <content:encoded><![CDATA[<P>A&nbsp;couple of days ago I had a question. One guy had to generate dimension set rules for ledger accounts, based on information from an Excel file. The file contained 3 columns: the first one for&nbsp;ledger accounts, the second one for values of&nbsp;the first dimension (say, Departments), and the third column for values of the second dimension (say, Cost Centers):</P>
<P>'10510', '49', '0'<BR>'10511', '49', '3'<BR>'10600', '49', '0'<BR>'10600', '49', '6'<BR>'10600', '50', '0'<BR>'10651', '49', '0'<BR>'10651', '50', '0'<BR>'10800', '49', '0'<BR>'10811', '49', '0'<BR>'10900', '49', '0'</P>
<P>and so on.&nbsp;As can be seen from the sample: </P>
<UL>
<LI>only department 49 and cost center 0 are valid for the account 10510;</LI>
<LI>only departments 49 and 50 are valid for 10600, while cost centers 0 and 6 are valid for department 49, and cost center 0 is valid for department 50;</LI>
<LI>the accounts 10800, 10811 and 10900 have department 49 and cost center 0 as the only valid values</LI></UL>
<P>etc.</P>
<P mce_keep="true">I have written a sample job that generates dimension set rules based&nbsp;on this information.</P>
<P mce_keep="true">Pre-conditions for the job:</P>
<OL>
<LI>
<DIV mce_keep="true">“Dept-cc” dimension set is created, composed of Department and Cost Center dimensions.</DIV></LI>
<LI>
<DIV mce_keep="true">The dimension set has neither hierarchies nor rules created.</DIV></LI>
<LI>
<DIV mce_keep="true">All mentioned ledger accounts exist in the chart of accounts.</DIV></LI></OL>
<P mce_keep="true">As a result of the job execution:</P>
<OL>
<LI>
<DIV mce_keep="true">Several dimensions set hierarchies will be generated. The number of hierarchies will be less than number of accounts, because some accounts have similar validation rules.</DIV></LI>
<LI>
<DIV mce_keep="true">The hierarchies will be updated and approved.</DIV></LI>
<LI>
<DIV mce_keep="true">There will be a dimension set rule collection created for “Dept-cc” dimension set.</DIV></LI>
<LI>
<DIV mce_keep="true">There will be several dimension set rules created – one per ledger account. The rules will be assigned to the rule collection.</DIV></LI></OL>
<P mce_keep="true">The job may be found in the attachment.</P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/01/81/17/44/job.txt" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-01-81-17-44/job.txt">job.txt</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Facts and Fallacies of Software Engineering</title>
      <link>https://docs.microsoft.com/archive/blogs/oleksandr_nazarov/facts-and-fallacies-of-software-engineering</link>
      <pubDate>Tue, 13 Feb 2007 15:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Sasha Nazarov]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/oleksandr_nazarov/2007/02/13/facts-and-fallacies-of-software-engineering/</guid>
      <description><![CDATA[I have just finished reading "Facts and Fallacies of Software Engineering", by Robert L....]]></description>
      <content:encoded><![CDATA[<P>I have just finished reading "<A class="" href="http://www.amazon.com/Facts-Fallacies-Software-Engineering-Robert/dp/0321117425/sr=8-1/qid=1171400000/ref=pd_bbs_sr_1/102-1164687-3939301?ie=UTF8&amp;s=books" mce_href="http://www.amazon.com/Facts-Fallacies-Software-Engineering-Robert/dp/0321117425/sr=8-1/qid=1171400000/ref=pd_bbs_sr_1/102-1164687-3939301?ie=UTF8&amp;s=books">Facts and Fallacies of Software Engineering</A>", by Robert L. Glass.</P>
<P>Quite a funny book, very easy to read. Highly recommended! Here are some of the facts he mentions and elaborates on:</P>
<UL>
<LI>Fact 2 - "The best programmers are up to 28 times better than the worst programmers, according to "individual differences" research. Given that their pay is never commensurate, they are the biggest bargains in the software field."</LI>
<LI>Fact 7 - "Software developers talk a lot about tools. They evaluate quite&nbsp;a few, buy a fair number, and use practically none."</LI>
<LI>Fact 23 - "One of the two most common causes of runaway projects is unstable requirements."</LI>
<LI>Fact 37 - "Rigorous inspections can remove up to 90 percent of errors from a software product before the first test case is run."</LI>
<LI>Fact 45 - "Better software engineering development leads to more maintenance, not less."</LI></UL>
<P>And here is a couple of the fallacies:</P>
<UL>
<LI>Fallacy 8 - "Given enough eyeballs, all bugs are shallow."</LI>
<LI>Fallacy 10 - "You teach people how to program by showing them how to write programs."</LI></UL>
<P>(...damn, all these books make me more and more sober-minded!..)</P>]]></content:encoded>
    </item>
  </channel>
</rss>