<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://addressof.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>AddressOf.com : VB6</title><link>http://addressof.com/blog/archive/tags/VB6/default.aspx</link><description>Tags: VB6</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>End of year wrap up (2011)</title><link>http://addressof.com/blog/archive/2011/12/24/End-of-year-wrap-up-_2800_2011_2900_.aspx</link><pubDate>Sat, 24 Dec 2011 04:36:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746785</guid><dc:creator>CorySmith</dc:creator><slash:comments>0</slash:comments><comments>http://addressof.com/blog/comments/746785.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746785</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;BLOG&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;m currently in the planning stages to rebuild this site.&amp;nbsp; I&amp;#39;ve delayed doing this for a long time since I didn&amp;#39;t want to &amp;quot;break links&amp;quot;; however, one reason why I don&amp;#39;t contribute as much as I used to is the fact that I enjoy the comment interaction.&amp;nbsp; Thanks to blog spam, I had to disable anonymous comments and, since that time, my posts have slowed way down.&amp;nbsp; (Yes, CAPTCHA controls exist; however, it&amp;#39;s not that straight forward to implement on this now aging copy of community server.)&amp;nbsp; So, I&amp;#39;ve made the decision that it is time to do whatever is necessary to kick start things back into full gear and if this means that web links are broken in the process... so be it.&amp;nbsp; I&amp;#39;ll investigate ways to accommodate the change; however, at the end, it&amp;#39;s time to get&amp;#39;r&amp;#39;done.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Movie Jukebox&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;For those following along (for a while), I have another pet project that I built for my own purposes and have enjoyed the fruits of since that time.&amp;nbsp; I have four 400 disc DVD players connected to Media Center that allow me to choose among 1600 movies at the press of a button; and the overall cost of the hardware is amazingly small in comparison to other options.&amp;nbsp; I was recently approached by a long time friend regarding his desire to attempt to market the project and we made our first sale last week!&amp;nbsp; It&amp;#39;s officially a product now!!!!&amp;nbsp;  For full disclosure, I did have to address a few issues that I was ignoring (I knew what I was doing after all) and made a few enhancements to actually productize it for  a v1.0 release.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Fort Worth .NET Users Group&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve been knee deep in working to get the FWDNUG on track now that I&amp;#39;m the acting president.&amp;nbsp; Let&amp;#39;s just say that it&amp;#39;s been an adventure up to this point; however, I think things are starting to really come together and 2012 is starting to look like a very good year for the members of the group!&lt;/p&gt;&lt;p&gt;I also want to say how much fun the end-of-year party was; how often can one say that thanks to a .NET users group I got to shoot an AR-15, an AK-47 and a Colt .45! :-D&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;VB6 -&amp;gt; VB10 Comparison&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Look for additional entries on this to come in the first part of January.&amp;nbsp; Additionally, once VB11 is made available, I&amp;#39;ll be sure to do a follow up for any items that are appropriate.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;BASIC&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The pet project is still moving nicely along.&lt;/p&gt;&lt;p&gt;Parser/Interpreter &lt;/p&gt;&lt;p&gt;I think I&amp;#39;ve pretty much gotten the parsing and interpreter where I&amp;#39;d like to see it; at least for this project.  The performance is pretty good and works pretty&amp;nbsp;well on Windows Phone 7.&lt;/p&gt;&lt;p&gt;Portable Library&lt;/p&gt;&lt;p&gt;My decision to switch to the portable library project was, as far as I&amp;#39;m concerned, a very good one.  It does force me to have to think through how I&amp;#39;m going to implement portions of the project so that implementation can be segmented across different platforms, which at times can be a bit daunting in the midst of &amp;quot;just getting it done&amp;quot;.  However, even with the additional work that is involved, I do believe that the results are paying off.&lt;/p&gt;&lt;p&gt;Display&lt;/p&gt;&lt;p&gt;The &amp;quot;IDE&amp;quot; portions is pretty much 100% as well as most of the ANSI style &amp;quot;graphics&amp;quot;.  Additionally, CGA mode is mostly complete (except for my new arch enemy... CIRCLE).  As a follow up to the last post, the &amp;quot;last line issue&amp;quot; has been resolved by&amp;nbsp;no longer trying to reproduce the behavior of the original GW-BASIC... which is something that seems to be impossible because two different versions of GW-BASIC did it two different ways... so I decided to &amp;quot;fix the bug&amp;quot; and move on.&lt;/p&gt;&lt;p&gt;Keyboard&lt;/p&gt;&lt;p&gt;Working pretty well; however, I think I&amp;#39;m going to re-address this at a later time so that it is based on &amp;quot;scan codes&amp;quot; at a lower level and works across the various keyword appropriately.&lt;/p&gt;&lt;p&gt;File System&lt;/p&gt;&lt;p&gt;The file system over web services idea is working pretty well; however, there are significant issues that I&amp;#39;ve encountered due to a budget host environment.  Since my last post, I am now interested in attempting to build this over SkyDrive... so we&amp;#39;ll see where this goes as we move into the new year.&lt;/p&gt;&lt;p&gt;Sound&lt;/p&gt;&lt;p&gt;Silverlight 5 has been released, so now I can see if the improvements to low-level sound will help solve some of the issues I was facing.  I&amp;#39;ll update once I know more.&lt;/p&gt;&lt;p&gt;Keywords&lt;/p&gt;&lt;p&gt;As of this writing, 176 keywords have been implemented. For the most part, the majority of these keywords is pretty complete.  &lt;/p&gt;&lt;p&gt;Compatibility&lt;/p&gt;&lt;p&gt;All of the code that I&amp;#39;ve attempted to execute from the BASIC Computer Games - Microcomputer Edition book (c. 1979) works great.&amp;nbsp; I&amp;#39;ve been playing&amp;nbsp;Hunt the Wumpus;&amp;nbsp;that sure brings back a few memories. ;-)&amp;nbsp;&lt;/p&gt;&lt;p&gt;One of my original stated goals was to get this to the point where the original, unmodified, DONKEY.BAS code would execute as close to the original as possible.  As of this writing, the game can execute with only one minor modification to the original code; the culprit at this point is the SOUND statement, of which I&amp;#39;ve already mentioned I&amp;#39;m having to get a bit creative to solve.  The issue is not whether or not it can play sound; the SOUND statement was used as a means to throttle the game loop, which means I need to get my sound statement working the same.&amp;nbsp; In a world (Silverlight) where everything seems to want to be async, it&amp;#39;s proves to be a little bit of a problem but I think I&amp;#39;ve got a solution worked out.&amp;nbsp; Once done, the goal is to get all the original .BAS files included with DOS version 1.1 working.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Another interesting tidbit is that modifications had to be made to accommodate the actual sample code instead of relying 100% on the official documentation which neglects to mention a few quirks that I knew all those years ago but have since forgotten; such as the &amp;quot;optional&amp;quot; end quotation on string literals.  If it&amp;#39;s in the documentation, I couldn&amp;#39;t find it by scanning over it.&lt;/p&gt;&lt;p&gt;Summary&lt;/p&gt;&lt;p&gt;I&amp;#39;m still having a blast working on this project and can&amp;#39;t wait to see where it will lead.  It&amp;#39;s so much more fun now that it&amp;#39;s to the the point where the original code comes to life.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Be sure, I have a few other tidbits that I&amp;#39;m working on and a ton of ideas that I&amp;#39;m working through with regards to this site; so stay tuned.&amp;nbsp; Let&amp;#39;s just say if 2012 is the year the world comes to an end... I&amp;#39;ve got a lot of stuff on my plate that I want to accomplish before hand. ;-)&amp;nbsp; In all seriousness, I look forward to 2012 and hope that everyone enjoys success and prosperity in the new year.&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746785" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/General/default.aspx">General</category><category domain="http://addressof.com/blog/archive/tags/VB/default.aspx">VB</category><category domain="http://addressof.com/blog/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://addressof.com/blog/archive/tags/Geek+Gathering/default.aspx">Geek Gathering</category><category domain="http://addressof.com/blog/archive/tags/Community+Server/default.aspx">Community Server</category><category domain="http://addressof.com/blog/archive/tags/Windows/default.aspx">Windows</category><category domain="http://addressof.com/blog/archive/tags/Random/default.aspx">Random</category><category domain="http://addressof.com/blog/archive/tags/User+Group/default.aspx">User Group</category><category domain="http://addressof.com/blog/archive/tags/Media+Center/default.aspx">Media Center</category><category domain="http://addressof.com/blog/archive/tags/Presentations/default.aspx">Presentations</category><category domain="http://addressof.com/blog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category><category domain="http://addressof.com/blog/archive/tags/BASIC/default.aspx">BASIC</category></item><item><title>VB10 vs VB6: Variants are not supported.</title><link>http://addressof.com/blog/archive/2011/07/27/VB10-vs-VB6_3A00_-Variants-are-not-supported_2E00_.aspx</link><pubDate>Wed, 27 Jul 2011 16:31:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746773</guid><dc:creator>CorySmith</dc:creator><slash:comments>1</slash:comments><comments>http://addressof.com/blog/comments/746773.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746773</wfw:commentRss><description>&lt;p&gt;This is part of series of posts categorized under &lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;&lt;font color="#000000"&gt;VB10 vs VB6&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;quot;Variants are &lt;strong&gt;not&lt;/strong&gt; supported. Object is now the default data type.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Wow!&amp;nbsp; Really?!?!?&amp;nbsp; Someone actually &amp;quot;defending&amp;quot; (or rather complaining) that Variants are not supported?&amp;nbsp; In any case...&lt;/p&gt;&lt;p&gt;Based on the wording of the entry, it is completely false to say &amp;quot;Variants are not supported.&amp;quot;.&amp;nbsp; They are completely supported.&amp;nbsp; However, it is also&amp;nbsp;true that Object is now the default data type.&amp;nbsp; I know that seems a little confusing; so let me explain.&amp;nbsp; &lt;/p&gt;&lt;p&gt;In VB6, the default &amp;quot;unknown&amp;quot; type was a Variant.&amp;nbsp; In VB10, the base type (since VB10 is a true object oriented language) is Object; of which all types derive.&amp;nbsp; It is also important to understand that Variant is *not* a native data type in VB10.&amp;nbsp; &lt;/p&gt;&lt;p&gt;So how, you may ask, does VB10 have support for Variant if there isn&amp;#39;t a data type of Variant?&amp;nbsp; Think about it for a moment.&amp;nbsp; Where is Variant needed?&amp;nbsp; VB4 (32-bit) through VB6 is a COM (aka ActiveX / OLE Automation) based product.&amp;nbsp; Because of this, Variant made sense since this is a &amp;quot;native&amp;quot; type of the COM world.&amp;nbsp; .NET has its own type system; of which Variant is not a &amp;quot;native&amp;quot; type.&amp;nbsp; However, .NET is great about interoperating&amp;nbsp;with other technologies which includes COM.&amp;nbsp; Because of this, there is full support for the Variant data type when working with COM interfaces.&lt;/p&gt;&lt;p&gt;Verdict:&lt;/p&gt;&lt;p&gt;VB10 does have support for Variants; so you be the judge.&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746773" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6: Option Base</title><link>http://addressof.com/blog/archive/2011/06/29/VB10-vs-VB6_3A00_-Option-Base.aspx</link><pubDate>Wed, 29 Jun 2011 12:55:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746761</guid><dc:creator>CorySmith</dc:creator><slash:comments>0</slash:comments><comments>http://addressof.com/blog/comments/746761.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746761</wfw:commentRss><description>&lt;p&gt;This is part of series of posts categorized under &lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;&lt;font color="#000000"&gt;VB10 vs VB6&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;quot;Option Base is &lt;strong&gt;not&lt;/strong&gt; supported.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;OK, time for a little history (extremely shortened).&amp;nbsp; In the beginning, BASIC had 1 based arrays (May 1964).&amp;nbsp; The creators of BASIC realized that this had certain limitations to it so about five months later when version 2 of the language was released (October 1964), the arrays changed from being 1 based to 0 based.&amp;nbsp; Fast forward nearly 14 years (1978) and the language was going through the process of becoming a &amp;quot;standard&amp;quot; and the committee related to doing so fought among themselves until a compromise was made&amp;nbsp;by&amp;nbsp;creating OPTION BASE n so that the users of the language could decide for themselves what the base array number would be.&amp;nbsp; However, 0 was chosen as the default.&amp;nbsp; But wait, it gets more interesting when you fast forward another 6 years (1984) to yet another &amp;quot;standard&amp;quot; and they&amp;#39;ve changed the default from a 0 to a 1.&lt;/p&gt;&lt;p&gt;So you can see this issue has existed LONG before VB and will probably continue for a very long time.&amp;nbsp; There are definately cases to support both arguments; however, one thing that is interesting to note is the following statement:&lt;/p&gt;&lt;p&gt;&amp;quot;But there was still a major problem for beginners.&amp;nbsp; They shouldn&amp;#39;t have to learn about the OPTION BASE statement, but they would be surprised when they used &amp;#39;DIM X(10)&amp;#39; and got a list with eleven elements in it.&amp;quot; -- Kemeny/Kurtz @ 1984.&lt;/p&gt;&lt;p&gt;So where does this leave us.&amp;nbsp; First I have to state that this statement is, in fact, correct.&amp;nbsp; OPTION BASE does not exist in VB10.&amp;nbsp; However, I can somewhat see that since one of the major goals of .NET/CLS/CLR is to allow multiple languages to interoperate seemlessly with one another.&amp;nbsp; An array in each of the supported languages works the same across all supported languages.&amp;nbsp; OPTION BASE would require the VB compiler to have to do all sorts of translations, which I suspect would not be too much work to accomplish.&amp;nbsp; However, if someone documented a method in VB using OPTION BASE 1 and someone in C#, F#, Ruby, Python, etc. were to try to utilize the result; they&amp;#39;d be left in bit of a quandry as to why array(0) exists.&lt;/p&gt;&lt;p&gt;However, let&amp;#39;s say for argument sake that cross language isn&amp;#39;t something a particular developer ever has to face.&amp;nbsp; Let&amp;#39;s say that this developer is going to only &amp;quot;consume&amp;quot; the produce and never produce anything that will be reused by anyone else.&amp;nbsp; So in this case, it might be nice to have the ability to define the base of an array to be 0 or 1 depending on their specific needs.&amp;nbsp; The problem that I&amp;#39;ve found is that circumstances seem to be so varied regarding when 0 or 1 seems to be the more natural choice that, at least to me, I find it simpler to keep the foundation at one level so that I know where I stand.&amp;nbsp; Meaning, I know that an array always starts at 0 so all my code can be built as such.&lt;/p&gt;&lt;p&gt;I do also have to say I understand, and even agree, that it&amp;#39;d be nice to have the ability to create an array that has a more natural feel to it depending on the circumstances at hand.&amp;nbsp; So....&lt;/p&gt;&lt;p&gt;At the end of the day, OPTION BASE probably isn&amp;#39;t needed.&amp;nbsp; The ability to define an array with a &amp;quot;custom&amp;quot; lower bound, on an array by array basis is what I would say would be a much more appropriate solution.&amp;nbsp; VB10 has plenty of ways to accomplish this, of which&amp;nbsp;I&amp;#39;ve already &lt;a href="http://addressof.com/blog/archive/2011/06/04/VB10-vs-VB6_3A00_-Array-Lower-Bounds.aspx"&gt;covered&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Verdict:&lt;/p&gt;&lt;p&gt;This discussion has been going on for 47 years now... so who am I to sway it one way or the other.&amp;nbsp; With that said, technically VB10 does not have OPTION BASE, so it seems I have to give this one to VB6.&amp;nbsp; However, as covered in the lower bound array post, VB10 has an incredible amount of flexibility in creating &amp;quot;arrays&amp;quot; / classes to better handle the specific needs with regards to a collection of information.&amp;nbsp; So I leave this one as an excercise to the reader to draw&amp;nbsp;thier own conclusion.&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746761" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6: Dynamic Arrays Usage In Structures</title><link>http://addressof.com/blog/archive/2011/06/20/VB10-vs-VB6_3A00_-Dynamic-Arrays-Usage-In-Structures.aspx</link><pubDate>Mon, 20 Jun 2011 14:42:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746751</guid><dc:creator>CorySmith</dc:creator><slash:comments>0</slash:comments><comments>http://addressof.com/blog/comments/746751.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746751</wfw:commentRss><description>&lt;p&gt;This is part of series of posts categorized under &lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;VB10 vs VB6&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;quot;Dynamic arrays are not allowed within structures (UDTs) &amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;m kind of scratching my head by this statement as I&amp;#39;m not entirely sure what he means by&amp;nbsp;&amp;quot;dynamic arrays&amp;quot;.&amp;nbsp; I will assume that he means:&lt;/p&gt;&lt;p&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;Structure&lt;/font&gt;&amp;nbsp;&lt;font color="#2b91af"&gt;SomeType&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;Public&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;SomeArray() &lt;/font&gt;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color:blue;"&gt;Integer&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;End Structure&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The above is an array of integers that has no defined indexer.&amp;nbsp; Additionally, the above code does not present any sort of error within Visual Studio.&lt;/p&gt;&lt;p&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&amp;nbsp;s &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;/font&gt;&lt;span style="color:blue;"&gt;&lt;font color="#2b91af" face="Consolas"&gt;SomeType&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt; &lt;br /&gt;Redim&amp;nbsp;&lt;font color="#000000"&gt;s(20)&lt;/font&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Again, the above code appears to be syntactically correct within Visual Studio.&amp;nbsp; So we created a structure, defined an array and redimensioned the array.&amp;nbsp; &lt;/p&gt;&lt;p&gt;However, with the advent of Generics and the flexibility that they bring to the table, I&amp;#39;d modify the structure so that it utilizes a Generic List as follows:&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp; Public&lt;/span&gt;&lt;font color="#000000"&gt; SomeArray() &lt;/font&gt;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;List&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;span style="color:blue;"&gt;Of Integer&lt;font color="#000000" size="2"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;You would, however, have to initialize the array as it would begin &amp;quot;life&amp;quot; as Nothing.&amp;nbsp; To do this:&lt;/p&gt;&lt;p&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt; s &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;/font&gt;&lt;span style="color:blue;"&gt;&lt;font color="#2b91af" face="Consolas"&gt;SomeType&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt; &lt;br /&gt;&lt;font color="#000000"&gt;s.SomeArray = &lt;font color="#0000ff"&gt;New &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;span style="color:blue;"&gt;Of Integer&lt;font color="#000000" size="2"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Arial" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;From here, you could use the Add, Insert, Remove, etc. available on the Generic List to truly provide a &amp;quot;dynamic array&amp;quot; that is far above and beyond what was&amp;nbsp;available&amp;nbsp;with VB6 &amp;quot;native&amp;quot; arrays.&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Verdict: &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;So unless I&amp;#39;m misinterpreting the statement, VB does fully support &amp;quot;dynamic arrays&amp;quot; in user defined types (Structures).&amp;nbsp; With that said, I have to hand this one to VB10.&lt;br /&gt;&lt;br /&gt;Update(s):&lt;br /&gt;&lt;br /&gt;Well, technically not an update as it was in an email I got before I finished writing this entry, &lt;a href="http://msmvps.com/blogs/bill/Default.aspx"&gt;Bill McCarthy&lt;/a&gt; (MVP) points out that this &amp;quot;issue&amp;quot; may be related to usage of dynamic arrays in stuctures with regards to Win32 API and the &amp;quot;default marshalling&amp;quot; done.&amp;nbsp; This is a very good point and one that can be anwered by pointing to the previous entry where I point out that the .NET interop story is much better than the VB6 counterpart.&amp;nbsp; With that said, I&amp;#39;d like to point you to the complete list of ways that the .NET interop mechanism can do using the MarshalAs attribute.&amp;nbsp; See &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.unmanagedtype.aspx"&gt;MSDN Unmanaged Type Enum&lt;/a&gt;.&amp;nbsp; As you can see, you have a plethora of choices specifically regarding arrays.&amp;nbsp; Thanks Bill for bringing this to my attention.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746751" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6: Array Lower Bounds</title><link>http://addressof.com/blog/archive/2011/06/04/VB10-vs-VB6_3A00_-Array-Lower-Bounds.aspx</link><pubDate>Sat, 04 Jun 2011 14:36:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746744</guid><dc:creator>CorySmith</dc:creator><slash:comments>2</slash:comments><comments>http://addressof.com/blog/comments/746744.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746744</wfw:commentRss><description>&lt;p&gt;This is part of series of posts categorized under &lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;VB10 vs VB6&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Arrays may &lt;strong&gt;not&lt;/strong&gt; have a lower bound other than zero.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
This, as it turns out, is absolutely true; however, with a twist.&amp;nbsp; Although VB10 does not allow the &amp;quot;native&amp;quot; array type (the one defined by the language), there are a ton of ways that this can be handled.&amp;nbsp; I would also argue that the multitude of ways that are available would also provide a solution that better suites the needs for circumstances where having a different lower bound is desired.&lt;/p&gt;&lt;p&gt;Let&amp;#39;s see how you could accomplish&amp;nbsp;similar functionality&amp;nbsp;without delving into the .NET Framework.&amp;nbsp; The most direct solution is to handle the lower bound yourself by determining the offset from 0 and access the array accordingly.&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;Dim&lt;/span&gt; lbound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;font color="#000000"&gt; =&amp;nbsp;10&lt;font face="Arial" size="2"&gt;&amp;nbsp;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;Dim&lt;/span&gt;&lt;font color="#000000"&gt; ubound &lt;/font&gt;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color:blue;"&gt;Integer&lt;font color="#000000"&gt; = 20&lt;font face="Arial" size="2"&gt;&amp;nbsp;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;Dim&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;a&lt;font face="Arial" size="2"&gt;(ubound - lbound)&lt;/font&gt; &lt;/font&gt;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color:blue;"&gt;Integer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;a(10 - lbound) =&amp;nbsp;value&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So you could easily handle&amp;nbsp;this by utilizing some simple&amp;nbsp;math.&amp;nbsp; Let&amp;#39;s say, however, that you&amp;#39;d like to have&amp;nbsp;it programatically similar to VB6.&amp;nbsp; You could create a&amp;nbsp;class that&amp;nbsp;abstracts this math and provides a very similar experience to VB6.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;Dim&lt;/span&gt;&lt;font color="#000000"&gt; a &lt;span style="color:blue;"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&lt;span style="color:blue;"&gt;As New&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;VbIntegerArray&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Arial" size="2"&gt;(lbound,&amp;nbsp;ubound)&lt;br /&gt;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;a(10) = value&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;The code for the VbIntegerArray is as follows:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;span style="color:blue;font-family:Consolas;font-size:9.5pt;"&gt;Public&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;VbIntegerArray&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Private&lt;/span&gt; m_lbound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Private&lt;/span&gt; m_int() &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; &lt;span style="color:blue;"&gt;New&lt;/span&gt;(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; lowerBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;, &lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; upperBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Me&lt;/span&gt;.ReDim(lowerBound, upperBound)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; [ReDim](&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; lowerBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;, &lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;
upperBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;m_lbound
= lowerBound&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;ReDim&lt;/span&gt; m_int(upperBound - lowerBound + 1)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Default&lt;/span&gt; &lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Property&lt;/span&gt; Item(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;
index &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)
&lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Get&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Return&lt;/span&gt; m_int(index - m_lbound)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Get&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Set&lt;/span&gt;(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; Value &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;m_int(index - m_lbound) = Value&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Set&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Property&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;font-family:Consolas;font-size:9.5pt;"&gt;End&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Not too difficult.&amp;nbsp; Note, this code is based off of a &lt;a href="http://blogs.msdn.com/b/vbfaq/archive/2004/04/20/116660.aspx"&gt;blog entry&lt;/a&gt; by &lt;a href="http://www.philweber.com/"&gt;Phil Weber&lt;/a&gt;.&amp;nbsp;&amp;nbsp;I made a few minor changes to, so feel free to use this or his depending on your needs.&amp;nbsp; Using this method requires that you create a seperate class for each variable type you want to have an &amp;quot;array&amp;quot; with a different lower bounds than 0.&amp;nbsp; Another approach, as mentioned toward the end of Phil&amp;#39;s blog entry is the possibility of using Generics.&amp;nbsp; I&amp;#39;ve re-wired the above class to create a generic version.&amp;nbsp; The internal implementation is not a &amp;#39;native&amp;#39; language array, but instead is leveraging the Generic List object.&amp;nbsp; Because of this, I am having to prepopulate the &amp;quot;array&amp;quot; with items so that the indexer works as expected.&amp;nbsp; Furthermore, because it is a generic type, I&amp;#39;m populating each entry with Nothing (NULL).&amp;nbsp; Outside of that, everything is basically similar to the direct implementation.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="color:blue;font-family:Consolas;font-size:9.5pt;"&gt;Public&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;VbArrayGeneric&lt;/span&gt;(&lt;span style="color:blue;"&gt;Of&lt;/span&gt;
T)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Private&lt;/span&gt; m_lbound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Private&lt;/span&gt; m_array &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;(&lt;span style="color:blue;"&gt;Of&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;T&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; &lt;span style="color:blue;"&gt;New&lt;/span&gt;(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; lowerBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;, &lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; upperBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Me&lt;/span&gt;.ReDim(lowerBound, upperBound)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; [ReDim](&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; lowerBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;, &lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;
upperBound &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;m_lbound
= lowerBound&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;m_array.Clear()&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;For&lt;/span&gt; index &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt; = 0 &lt;span style="color:blue;"&gt;To&lt;/span&gt;
upperBound - lowerBound&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;m_array.Add(&lt;span style="color:blue;"&gt;Nothing&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Next&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Default&lt;/span&gt; &lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Property&lt;/span&gt; Item(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;
index &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)
&lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;T&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Get&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Return&lt;/span&gt; m_array(index - m_lbound)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Get&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Set&lt;/span&gt;(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; Value &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;T&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;m_array(index - m_lbound) = Value&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Set&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Property&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="color:blue;font-family:Consolas;font-size:9.5pt;"&gt;End&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;To utilize the above code, you can do the following: &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&lt;p&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;Dim&lt;/span&gt; a &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;New&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;VbArrayGeneric&lt;/span&gt;(&lt;span style="color:blue;"&gt;Of&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt;)(10, 20)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;For&lt;/span&gt; index &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt; = 10 &lt;span style="color:blue;"&gt;To&lt;/span&gt; 20&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;a(index) = index&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;Next&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;/font&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;For&lt;/span&gt; index &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Integer&lt;/span&gt; = 10 &lt;span style="color:blue;"&gt;To&lt;/span&gt; 20&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(a(index))&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;Next&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;
&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;In addition to the ways described, the Generic version of the Dictionary class might also be leveraged to provide similar capabilities.&amp;nbsp; By using a dictionary, you would no longer be bound (no pun intended) to a lower and upper bound since each entry has a unique key and can be of any value. If interested in seeing this approach, please let me know.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Verdict:&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;This one&amp;#39;s hard to provide a clear verdict.&amp;nbsp;&amp;nbsp;On the&amp;nbsp;one hand, it&amp;#39;s clear that the &amp;#39;native&amp;#39;&amp;nbsp;language array&amp;nbsp;does not support&amp;nbsp;arrays with a lower bound other than 0.&amp;nbsp; On the other, there are a plethora of ways to implement &amp;quot;arrays&amp;quot; available in VB10.&amp;nbsp; Because of this, I&amp;#39;m going to call this one a wash.&amp;nbsp; (Note: I may come back and give this one to VB6 depending on how the rest of the list goes; only because of the way that the entry was stated, VB10 does not do exactly what it states.)&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Update(s)&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;&lt;a href="http://msmvps.com/blogs/bill/Default.aspx"&gt;Bill McCarthy&lt;/a&gt; (MVP) writes in : &amp;quot;I&amp;#39;d add IEnumerable/IEnumerable(Of T) support to the classes passing it straight through to the array&amp;#39;s GetEnumerator.&amp;nbsp; And this is actually where it gets interesting. If I recall correctly For Each with arrays in .NET is optimised; you&amp;#39;d probably lose a little bit with the custom class, but as long as it was IEnumerable(Of T) as opposed to the non-generic version there shouldn&amp;#39;t be any boxing overhead. That said, I seem to recall (but don&amp;#39;t quote me on this as it is a LONG time ago), that VB6 had perf problems with For Each (pCode versus native may have changed the outcome too), as I think it went all variant gooey stuff ;) Anyway, real world implementation in .NET, include IEnumerable(Of T)&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746744" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6: Private Class Variables </title><link>http://addressof.com/blog/archive/2011/06/04/VB10-vs-VB6_3A00_-Private-Class-Variables-.aspx</link><pubDate>Sat, 04 Jun 2011 14:02:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746739</guid><dc:creator>CorySmith</dc:creator><slash:comments>1</slash:comments><comments>http://addressof.com/blog/comments/746739.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746739</wfw:commentRss><description>&lt;p&gt;This is part of series of posts categorized under &lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;VB10 vs VB6&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;quot;Private class variables are &lt;strong&gt;not&lt;/strong&gt; private to the class instance.&amp;quot; &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is another one of those &amp;quot;huh?&amp;quot; responses.&amp;nbsp; However, I&amp;#39;ll go ahead and discuss it anyway.&lt;/p&gt;

&lt;p&gt;As documented in the VB6 Programmers Guide on page 429, &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;quot;It&amp;#39;s just as easy to create private data for a class; simply declare a variable Private, and it will be accessible only from code within the class module.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;font face="Consolas" size="2"&gt;&lt;font color="#0000ff"&gt;Private&lt;/font&gt; mstrMothersMaidenName &lt;font color="#0000ff"&gt;As String&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;This is what I can only assume Karl is referring to with the statement that private class variables are not private to the class instance.&amp;nbsp; Based on this, let&amp;#39;s look at VB10:&lt;/p&gt;
&lt;p&gt;
&lt;font face="Consolas" size="2"&gt;&lt;font color="#0000ff"&gt;Class&lt;/font&gt; &lt;font color="#2b91af"&gt;Class1&lt;/font&gt;&lt;br /&gt;

&amp;nbsp;&amp;nbsp;&lt;font color="#0000ff"&gt;Private&lt;/font&gt; m_mothersMaidenName &lt;font color="#0000ff"&gt;As String&lt;/font&gt;&lt;br /&gt;

&lt;font color="#0000ff"&gt;End Class&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Consolas" size="2"&gt;

&lt;font color="#0000ff"&gt;Class&lt;/font&gt; &lt;font color="#2b91af"&gt;Class2&lt;/font&gt;&lt;br /&gt;
&amp;nbsp; &lt;font color="#0000ff"&gt;Sub&lt;/font&gt; DoSomething()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt; c &lt;font color="#0000ff"&gt;As New Class1&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; c.m_mothersMaidenName = &amp;quot;&amp;quot;&lt;br /&gt;
&amp;nbsp; &lt;font color="#0000ff"&gt;End Sub&lt;/font&gt;&lt;br /&gt;
&lt;font color="#0000ff"&gt;End Class&lt;/font&gt;&lt;/font&gt;

&lt;/p&gt;&lt;p&gt;I have to point out that this code will immediately draw your attention to it by draing a blue wavy line below it and in the Error List you&amp;#39;ll see something similar to the following:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;#39;Class1.m_mothersMaidenName&amp;#39; is not accessible in this context because it is &amp;#39;Private&amp;#39;.&amp;nbsp;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;At this point, you&amp;nbsp;are not able compile the code until error has to be addressed.&amp;nbsp; Sure looks like the private variable is private to the class to me.&lt;/p&gt;&lt;p&gt;Verdict:&lt;/p&gt;&lt;p&gt;Not much to say, this one just isn&amp;#39;t true.  It was never true to the best of my knowledge so the nod, again, has to go to VB10.&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Update(s):&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;&lt;a href="http://msmvps.com/blogs/bill/Default.aspx"&gt;Bill McCarthy&lt;/a&gt; (MVP) writes in : &amp;quot;I think this is referring to accessing private variables from *another* instance of the same class. Reason for its existence in .NET is two-fold: &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;first the addition of shared methods to a class: this is probably the heart of the technical reason why.&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;it also comes in handy a LOT for operator overloading (equality operators), serialization etc.&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;font color="#000000" face="Arial" size="2"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Interesting.&amp;nbsp; I can almost see this as being a possible point of contention.  However, just because you can &amp;quot;see&amp;quot; it doesn&amp;#39;t mean you can &amp;quot;use&amp;quot; it.&amp;nbsp;&amp;nbsp;&amp;nbsp;Serialization almost deserves it&amp;#39;s own conversation; however, there are cases where you might need access to &amp;quot;member variables&amp;quot;.&amp;nbsp; In any case,&amp;nbsp;when they are set to private they are, in fact, scoped as such.&amp;nbsp; I may have to give this more thought.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746739" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6: ByVal/ByRef within API calls. </title><link>http://addressof.com/blog/archive/2011/06/02/VB10-vs-VB6_3A00_-ByVal_2F00_ByRef-within-API-calls.-.aspx</link><pubDate>Thu, 02 Jun 2011 14:54:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746735</guid><dc:creator>CorySmith</dc:creator><slash:comments>0</slash:comments><comments>http://addressof.com/blog/comments/746735.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746735</wfw:commentRss><description>&lt;p&gt;This is part of series of posts categorized under &lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;VB10 vs VB6&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;quot;Use of &lt;strong&gt;ByVal/ByRef&lt;/strong&gt; directly within API calls is &lt;strong&gt;not&lt;/strong&gt;  supported.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Huh?&lt;/p&gt;

&lt;p&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Declare&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Function&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; SetEnvironmentVariable &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Lib&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&amp;quot;kernel32&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Alias&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&amp;quot;SetEnvironmentVariableA&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; ( _&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; ByVal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; lpName &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;,&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; ByVal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; lpValue &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;) &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Boolean&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;The above code is syntactically correct in VB6 and VB10.&amp;nbsp;Notice the inclusion of the word ByVal.&amp;nbsp; You could use ByRef as well.&amp;nbsp; Additionally, VB10 offers a plethora of additional options that allow you to further define how things are passed to various api implementations.&amp;nbsp; So the above statement could be written as:&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Declare&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Auto&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Function&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; SetEnvironmentVariable &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Lib&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&amp;quot;kernel32&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Alias&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&amp;quot;SetEnvironmentVariableA&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; (&lt;br /&gt;
&amp;nbsp; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;MarshalAsAttribute&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;UnmanagedType&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;.LPStr)&amp;gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; lpName &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;,&lt;br /&gt;
&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;MarshalAsAttribute&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;UnmanagedType&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;.LPStr)&amp;gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; lpValue &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;) &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Boolean&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;This will cause the strings to be passed as a long pointer to a string instead of a BStr.&amp;nbsp; Additionally, the Auto keyword will cause the interop process to use ANSI or Unicode strings depending on the target API.&lt;/p&gt;&lt;p&gt;What I&amp;#39;m showing here just scratches the surface of what VB10 can do regarding interoperating with the Windows API&amp;#39;s.&amp;nbsp; In any case, the ByVal keyword is definately there, so I&amp;#39;m not sure what Karl is trying to say with this one.&lt;/p&gt;&lt;p&gt;Verdict:&lt;/p&gt;&lt;p&gt;The statement that ByVal and ByRef are not supported is obviously false so I have to give this one to VB10.&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;span style="font-family:Consolas;font-size:9.5pt;"&gt;&lt;span style="color:blue;"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Update(s):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msmvps.com/blogs/bill/Default.aspx"&gt;Bill McCarthy&lt;/a&gt; (MVP) writes in: &amp;quot;Again my memory is getting rusty, but I think this refers to the use of As Any, then you could pass a variable out ByRef or ByVal.&amp;nbsp; Often the cause of many mistakes hard to track down as a variable address would be sent instead of the value etc.&amp;quot;&lt;br /&gt;&lt;br /&gt;Bill apparently agrees with me regarding &amp;quot;As Any&amp;quot; being a &amp;quot;bad thing&amp;quot;. ;-)&amp;nbsp; He does bring up a good point regarding ByRef/ByVal from the perspective of &amp;quot;how&amp;quot; interop works in .NET (thus VB10).&amp;nbsp;Win32 API signatures as defined in VB most likely will not be identical in behavior with the move to VB10.&amp;nbsp; With that said, using a site&amp;nbsp;such as&amp;nbsp;&lt;a href="http://pinvoke.net/"&gt;http://pinvoke.net/&lt;/a&gt;&amp;nbsp;to verify your signatures is the first thing that I would suggest.&amp;nbsp; Yes, this means that the trusty Win32 API book by Dan Appleman is a little out of date; however, it&amp;#39;s just the &amp;quot;signatures&amp;quot; that have to be dealt with since the .NET variety offers the granular level required to enable you to access **all** of the API available.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746735" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6: As Any</title><link>http://addressof.com/blog/archive/2011/05/31/VB10-vs-VB6_3A00_-As-Any.aspx</link><pubDate>Tue, 31 May 2011 04:13:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746732</guid><dc:creator>CorySmith</dc:creator><slash:comments>0</slash:comments><comments>http://addressof.com/blog/comments/746732.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746732</wfw:commentRss><description>&lt;p&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#000000"&gt;This is part of series of posts categorized under &lt;/font&gt;&lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;&lt;font color="#000000"&gt;VB10 vs VB6&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;Declare Sub&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt; ExternalMethodName &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Lib&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;SomeLibrary&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&amp;nbsp;someValue &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Any&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas" size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When working with Windows API&amp;#39;s, you use the DECLARE statement to define the external method.&amp;nbsp; In VB6, you could use the As Any variable declaration; doing so would allow you to pass &lt;strong&gt;any variable type&lt;/strong&gt; to the external method.&amp;nbsp; It&amp;#39;s key to note, when I say any, I mean &lt;strong&gt;any&lt;/strong&gt;.&amp;nbsp; VB6 would not protect you in any way against passing in something that you didn&amp;#39;t mean to do so.&amp;nbsp; Sure, this puts the responsiblity on the developer to do the right thing; however, last I checked, I now have 4 cores in my machine that are hyperthreaded providing 8 processing pipelines along with 16GB of memory.&amp;nbsp; I want my development environment to do everything it can to help me write better software.&amp;nbsp; Leaving it up to me to write comments or remember what types can be passed is kind of, well, annoying.&amp;nbsp; Wouldn&amp;#39;t it be great if there was some way that you could declare an external method that could support multiple valid appropriate variable types?&amp;nbsp; Oh wait, there is...&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Declare Sub&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; ExternalMethodName &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Lib&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&amp;quot;SomeLibrary&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; (&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; intValue &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Integer&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;)&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Declare&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Sub&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; ExternalMethodName &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;Lib&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&amp;quot;SomeLibrary&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; (&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; stringValue &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;VB10 allows you to use overloaded method signatures.&amp;nbsp; As long as the parameters have a different signature, as defined by the number, order and type of parameters, you can create as many of these as you&amp;#39;d need.&amp;nbsp; By doing this, the IDE and compiler are able to protect you from passing in something you didn&amp;#39;t mean to, thus helping you to write better applications.&amp;nbsp; And when using these externally defined methods, the correct one will be automatically utilized based on the&amp;nbsp;variable type that you use.&lt;/p&gt;
&lt;p&gt;Verdict:&lt;/p&gt;
&lt;p&gt;So although VB10 does not support As Any, I&amp;#39;d say that this is a case where the language has evolved and&amp;nbsp;it&amp;#39;s a solid step in the right direction.&amp;nbsp; When moving to VB10, the IDE is really great about pointing out what variable type(s) you might be using and it takes only moments to rid yourself of the troublesome As Any pitfalls utilizing overloaded declares.&amp;nbsp; With that said, I&amp;#39;m going to give this one to VB10.&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746732" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6: VarPtr, StrPtr, ObjPtr</title><link>http://addressof.com/blog/archive/2011/05/30/VB10-vs-VB6_3A00_-VarPtr_2C00_-StrPtr_2C00_-ObjPtr.aspx</link><pubDate>Sun, 29 May 2011 22:12:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746727</guid><dc:creator>CorySmith</dc:creator><slash:comments>1</slash:comments><comments>http://addressof.com/blog/comments/746727.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746727</wfw:commentRss><description>&lt;p&gt;This is part of series of posts categorized under &lt;a href="http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx"&gt;VB10 vs VB6&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;As it turns out, I still have a copy of Microsoft Visual Basic 6.0 Programmer&amp;#39;s Guide.&amp;nbsp; This was an excellent resource for learning VB6 and it&amp;#39;s what I&amp;#39;ll be using&amp;nbsp;as a&amp;nbsp;reference in these posts for comparison.&lt;/p&gt;&lt;p&gt;With that said, I have to point immediately that VarPtr, StrPtr and ObjPtr are *NOT* mentioned in this Programmer&amp;#39;s Guide.&amp;nbsp; These were functions that were &amp;quot;somewhat undocumented&amp;quot; and were only used by developers whom were pushing the limits of VB6 well beyond its original design and/or where they needed to work around the inherent limitations of the IDE, language and or runtime.&lt;/p&gt;&lt;p&gt;Don&amp;#39;t get me wrong, they were used in nearly every serious application ever developed in VB6; mainly by people who copied and pasted code they found elsewhere to work around the&amp;nbsp;limitations in VB6 as time and technology&amp;nbsp;marched beyond 1998.&amp;nbsp; Many of these developers had no fundamental idea of how these procedures they where&amp;nbsp;utilizing actually worked under the hood, they were just trying to get their job done.&lt;/p&gt;&lt;p&gt;When I was upgrading projects from VB6 to VB7, I encountered a ton of these with the highest encountered one being related to mouse/keyboard &amp;quot;hooking&amp;quot;.&amp;nbsp; In every case, I found built in functionality either in VB, Windows Forms&amp;nbsp;or .NET that completely removed the need to utilize these &amp;quot;hacks&amp;quot;.&lt;/p&gt;&lt;p&gt;With all that said, I find it interesting that Karl maintains the &amp;quot;&lt;a href="http://vb.mvps.org/tips/varptr.asp"&gt;Unofficial Documentation for VarPtr, StrPtr, and ObjPtr&lt;/a&gt;&amp;quot;.&amp;nbsp; On this document, he states:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;quot;The VarPtr function has been in the BASIC language since long before it turned 
into QuickBasic and Visual Basic. VarPtr has been in the VB runtime since 
version 1.0.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;According to a post found &lt;a href="http://www.xtremevbtalk.com/showthread.php?t=35137"&gt;here&lt;/a&gt;, VARPTR is one of the keywords that is specifically mentioned as being &amp;quot;keywords that are either not supported by VB or are being used in different  context, or, have become properties/methods of some VB objects (and therefore  could not stand as an independent statement)&amp;quot;.  It&amp;#39;s been so long since I&amp;#39;ve used QB that I can&amp;#39;t remember any of specifics one way or the other.&lt;/p&gt;&lt;p&gt;I find it interesting that he points out that VarPtr was in QB; however, fails to mention that it worked a little bit differently... a complaint that he is making with the move to newer versions of VB.&amp;nbsp; I also suspect that there would have been some changes between its usage in in VB1 though VB4 when you transitioned from 16-bit to 32-bit.&amp;nbsp; What makes all the more interesting is actually reading his unofficial documentation where he points out that there are differences between VB4, VB5 and VB6 with this functionality and the work arounds you have to do to get it to be &amp;quot;right&amp;quot;.&amp;nbsp; And he complains about the &amp;quot;duct tape&amp;quot; solution provided by VarPtr, et. al. being removed?&amp;nbsp; &lt;/p&gt;&lt;p&gt;So what can one do when moving to VB10?&lt;/p&gt;&lt;p&gt;I have to point out that many of the hacks that were required in VB6 that leveraged these keywords are no longer needed with specific regards to Windows development.&amp;nbsp; Additionally, for the times that this is not the case, the Win32 interop story in VB10 is much, much, much better.&amp;nbsp; Additionally, it&amp;#39;s all 100% documented and 100% supported. ;-)&lt;/p&gt;&lt;p&gt;Note: If someone would like to send me an small example of where these keywords&amp;nbsp;were needed, I&amp;#39;d be happy to provide details about why they are no longer needed or how to leverage the Win32 API using VB10 in the cases where&amp;nbsp;built in functionality does not&amp;nbsp;already exist.&amp;nbsp;&amp;nbsp; It&amp;#39;d be nice to have a specific example on this for future reference.&lt;/p&gt;&lt;p&gt;Verdict:&lt;/p&gt;&lt;p&gt;Given that these functions were for the elite of the elite VB developers; I&amp;#39;m going to go out on a limb here and state that if you could hack your way through things in this manner, leveraging the documented methods in .NET should make things a whole lot simpler.&amp;nbsp; For those that were just needing the results of these creative coders, a lot of this functionality is &amp;quot;included in the box&amp;quot;.&amp;nbsp; Given those two factors, VB10 wins.&lt;/p&gt;&lt;p&gt;Updates(s):&lt;/p&gt;&lt;p&gt;&lt;a href="http://msmvps.com/blogs/bill/Default.aspx"&gt;Bill McCarthy&lt;/a&gt; (MVP) writes in: &amp;quot;StrPtr was often needed when calling Unicode API (assuming you pre-allocated the string) ObjPtr was sometimes used with windows subclassing calls: Was fraught with danger. I think Karl Peterson finally wrote an article for VSM a year or two ago admitting that using ObjPtr with subclassing could result in the wrong instance being called, and recommended to folks the use an external library for subclassing (one that ships with XP or later I think). Was kind-of funny to see it only took 10 years to admit it (lol).&amp;quot;&lt;/p&gt;&lt;p&gt;My only reply: :-)&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746727" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item><item><title>VB10 vs VB6 (aka VFred vs Classic VB)</title><link>http://addressof.com/blog/archive/2011/05/29/VB10-vs-VB6-_2800_aka-VB.FRED_2900_.aspx</link><pubDate>Sun, 29 May 2011 21:47:00 GMT</pubDate><guid isPermaLink="false">71d585fb-e1da-4feb-ae24-6d48b96093ce:746726</guid><dc:creator>CorySmith</dc:creator><slash:comments>18</slash:comments><comments>http://addressof.com/blog/comments/746726.aspx</comments><wfw:commentRss>http://addressof.com/blog/commentrss.aspx?PostID=746726</wfw:commentRss><description>&lt;p&gt;A couple of weeks ago there was a rumor that was flying around regarding VB6 being made open source.&amp;nbsp; This was completely untrue; however, in the aftermath, the FUD machine has kicked back into gear.&lt;/p&gt;&lt;p&gt;A lot of this FUD can be traced to a single source... &lt;a href="http://vb.mvps.org/"&gt;Karl E. Peterson&lt;/a&gt;.&amp;nbsp; He created and &amp;quot;maintains&amp;quot; the &lt;a href="http://vb.mvps.org/vfred/breaks.asp"&gt;VB.NOT&lt;/a&gt; l and can be credited with the term VFred.&amp;nbsp; This crusade of his, in my opinion, is directly or indirectly one of the main reasons why a lot of VB developers have decided stay with VB6, to find another platform altogether or, if they decided to move to .NET, decided to give C# a go &amp;quot;since it&amp;#39;s a whole new language to learn anyway&amp;quot;.&amp;nbsp; It&amp;#39;s interesting to note that many of the features that VB has had all along are now being demanded by C# developers and my suspicion&amp;nbsp;is that those whom are demanding these features are ex-VB developers.&lt;/p&gt;&lt;p&gt;In any case, I still use VB and will continue to use it as long as I can possibly do so.&amp;nbsp; I think BASIC is one of the best languages out there and the fact that I&amp;#39;ve been able to utilize it for the past 30+ years stands as a testimant to that fact.&lt;/p&gt;&lt;p&gt;I think that Karl should be following up on his list with each revision of VB and he, as best as I can tell, has not done so.&amp;nbsp; So he helped create the mess and is unwilling to do anything to repair the damage he&amp;#39;s done.&amp;nbsp; With that said, I&amp;#39;m going to address his original list by comparing VB10 to VB6.&lt;/p&gt;&lt;p&gt;To collect these together, I&amp;#39;ll be using the VB6 tag.&amp;nbsp; This tag does not mean that I&amp;#39;ll be switching back to VB6. ;-)&amp;nbsp; I&amp;#39;ve tried that a couple of times just for giggles and it&amp;#39;s pure torture to work in that IDE after more recent version of VB.&lt;/p&gt;&lt;p&gt;Before I get started, I have to point out a few things that he states on his site.&lt;/p&gt;&lt;p&gt;On&amp;nbsp;the list he states:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&amp;quot;Before anyone spends hours writing &amp;quot;rebuttals&amp;quot; to the points 
below&lt;/strong&gt;, it may help to understand the original purpose of this list. The 
points are &lt;strong&gt;not&lt;/strong&gt; intended to highlight unintelligent design, in either 
Classic VB or VFred. Can that be said any clearer? The points are intended 
solely to demonstrate the enormity of incompatibility between Classic VB and 
VFred. That&amp;#39;s it. In a nutshell, there is no backward- or forward-compatibility, 
between the two languages.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;
Depending who you ask, each point below may be considered anywhere from 
&amp;quot;gratuitous&amp;quot; to &amp;quot;essential.&amp;quot; Either way, if the feature in question is one you 
used in Classic VB, you will need to address this change, and determine what, if 
any, workaround may be available. But the point is, the fact a workaround 
is necessary indicates somethings broken. That something, in this case, is your 
code/investment.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;So basically he is saying, &amp;quot;Hey, all of this is broken and there&amp;#39;s nothing you can do about it and Microsoft is going to do nothing about it.&amp;nbsp; &amp;nbsp;And don&amp;#39;t complain to me or try to correct me because, if any one item is different, it&amp;#39;s all bad.&amp;quot;&lt;/p&gt;&lt;p&gt;Furthermore, he states:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;quot;So, without further ado, the bullets you will &lt;strong&gt;not&lt;/strong&gt; see coming from 
Microsoft.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Which, I think is&amp;nbsp;irresponsible for the perspective that he&amp;nbsp;obviously has not&amp;nbsp;followed up on this list in the&amp;nbsp;5 versions (VB7.0, VB7.1, VB8.0, VB9.0 and VB10.0) that have been released since he created his original list.&amp;nbsp;He created this list during the original VB7 BETA and updated it as of the second VB7 BETA.  So his list doesn&amp;#39;t even reflect a released product; yet he still maintains the list and many people still refer to this list.  Bottom line, it&amp;#39;s irresponsible to maintain such a list, evangelize such a list and read such a list without double checking the facts.&lt;/p&gt;&lt;p&gt;So, fine, don&amp;#39;t consider this a &amp;quot;rebuttal&amp;quot;; look at this as a &amp;quot;progress report&amp;quot;.&amp;nbsp; It&amp;#39;s been about 10 years since this list was put together.&amp;nbsp; My goal is not to point out how wrong it is.&amp;nbsp; I will just be using it to point out where we are TODAY.&lt;/p&gt;&lt;p&gt;The following is a copy of his list as of 5/29/2011.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/05/30/VB10-vs-VB6_3A00_-VarPtr_2C00_-StrPtr_2C00_-ObjPtr.aspx"&gt;&lt;em&gt;VarPtr&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; &lt;strike&gt;supported&lt;/strike&gt; available. 
&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/05/30/VB10-vs-VB6_3A00_-VarPtr_2C00_-StrPtr_2C00_-ObjPtr.aspx"&gt;&lt;em&gt;StrPtr&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; &lt;strike&gt;supported&lt;/strike&gt; available. 
&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/05/30/VB10-vs-VB6_3A00_-VarPtr_2C00_-StrPtr_2C00_-ObjPtr.aspx"&gt;&lt;em&gt;ObjPtr&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; &lt;strike&gt;supported&lt;/strike&gt; available.&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/05/31/VB10-vs-VB6_3A00_-As-Any.aspx"&gt;&lt;em&gt;As Any&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported for API Declares. 
&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/06/02/VB10-vs-VB6_3A00_-ByVal_2F00_ByRef-within-API-calls.-.aspx"&gt;Use of &lt;em&gt;ByVal&lt;/em&gt;/&lt;em&gt;ByRef&lt;/em&gt; directly within API calls is &lt;strong&gt;not&lt;/strong&gt; 
supported. &lt;/a&gt;
&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/06/04/VB10-vs-VB6_3A00_-Private-Class-Variables-.aspx"&gt;&lt;em&gt;Private&lt;/em&gt; class variables are &lt;strong&gt;not&lt;/strong&gt; private to the class instance. 

&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/06/04/VB10-vs-VB6_3A00_-Array-Lower-Bounds.aspx"&gt;Arrays may &lt;strong&gt;not&lt;/strong&gt; have a lower bound other than zero.&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/06/20/VB10-vs-VB6_3A00_-Dynamic-Arrays-Usage-In-Structures.aspx"&gt;Dynamic arrays are &lt;strong&gt;not&lt;/strong&gt; allowed within structures (UDTs)&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;&lt;strike&gt;Arrays are &lt;strong&gt;not&lt;/strong&gt; declared using the upper bound.&lt;/strike&gt; &lt;font color="#c00000"&gt;(Addressed in Beta2)&lt;/font&gt; 
&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/06/29/VB10-vs-VB6_3A00_-Option-Base.aspx"&gt;&lt;em&gt;Option Base&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://addressof.com/blog/archive/2011/07/27/VB10-vs-VB6_3A00_-Variants-are-not-supported_2E00_.aspx"&gt;&lt;em&gt;Variant&lt;/em&gt;s are &lt;strong&gt;not&lt;/strong&gt; supported. Object is now the default data 
type.&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Currency&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Date&lt;/em&gt;s are &lt;strong&gt;not&lt;/strong&gt; stored internally as &lt;em&gt;Double&lt;/em&gt; values. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Long&lt;/em&gt;s are &lt;strong&gt;not&lt;/strong&gt; 32-bits; they are 64-bits. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Integer&lt;/em&gt;s are &lt;strong&gt;not&lt;/strong&gt; 16-bits; they are 32-bits. 
&lt;/li&gt;&lt;li&gt;&lt;strike&gt;&lt;em&gt;True&lt;/em&gt;, coerced to an Integer, is &lt;strong&gt;not&lt;/strong&gt; -1, but is 1 
instead.&lt;/strike&gt; &lt;font color="#c00000"&gt;(Addressed in Beta2)&lt;/font&gt; 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;Imp&lt;/em&gt; and &lt;em&gt;Eqv&lt;/em&gt; operators are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Fixed-length &lt;em&gt;String&lt;/em&gt;s are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;DefInt, DefLong&lt;/em&gt;, et al., are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Dim&lt;/em&gt; may &lt;strong&gt;not&lt;/strong&gt; always create procedure-level variables. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Redim&lt;/em&gt; will &lt;strong&gt;not&lt;/strong&gt; create arrays not already declared. 
&lt;/li&gt;&lt;li&gt;Local variables are &lt;strong&gt;not&lt;/strong&gt; necessarily visible (in scope) throughout a 
procedure. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;VarType&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Empty&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Null&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;IsEmpty&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;IsMissing&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;IsNull&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;IsObject&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Let&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Core language constants do &lt;strong&gt;not&lt;/strong&gt; have a &amp;quot;vb&amp;quot; prefix (&lt;em&gt;vbRed&lt;/em&gt; 
becomes &lt;em&gt;Red&lt;/em&gt;). 
&lt;/li&gt;&lt;li&gt;Terminate will &lt;strong&gt;not&lt;/strong&gt; fire when an object&amp;#39;s last reference is released. 
&lt;/li&gt;&lt;li&gt;Object finalization code will &lt;strong&gt;not&lt;/strong&gt; execute in a predictable order. 
&lt;/li&gt;&lt;li&gt;Implicit object creation is &lt;strong&gt;not&lt;/strong&gt; delayed until first reference. 
&lt;/li&gt;&lt;li&gt;Public object variables are &lt;strong&gt;not&lt;/strong&gt; safe from alteration when passed as 
parameters. 
&lt;/li&gt;&lt;li&gt;Can &lt;strong&gt;not&lt;/strong&gt; expose Property procedures with mixed visibility (&lt;em&gt;Friend 
Set/Public Get&lt;/em&gt;). 
&lt;/li&gt;&lt;li&gt;Procedure parameters are &lt;strong&gt;not&lt;/strong&gt; by default passed &lt;em&gt;ByRef&lt;/em&gt; anymore. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;ParamArray&lt;/em&gt; arguments are &lt;strong&gt;not&lt;/strong&gt; passed &lt;em&gt;ByRef&lt;/em&gt; anymore. 
&lt;/li&gt;&lt;li&gt;Property parameters may &lt;strong&gt;not&lt;/strong&gt; be passed &lt;em&gt;ByRef&lt;/em&gt; anymore. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Implements&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; implemented the same, so must be rewritten. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Static&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported as a procedure level modifier. 
&lt;/li&gt;&lt;li&gt;Use of &lt;em&gt;As New&lt;/em&gt; does &lt;strong&gt;not&lt;/strong&gt; force auto-reinstantiation when an 
object is released. 
&lt;/li&gt;&lt;li&gt;Parenthesis are &lt;strong&gt;not&lt;/strong&gt; optional when calling procedures. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Set&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported for object assignment. 
&lt;/li&gt;&lt;li&gt;Parameterless default properties are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Default values for &lt;em&gt;Optional&lt;/em&gt; parameters are &lt;strong&gt;not&lt;/strong&gt; optional. 
&lt;/li&gt;&lt;li&gt;Code is &lt;strong&gt;not&lt;/strong&gt; compiled to native, thus making decompilation much 
easier. 
&lt;/li&gt;&lt;li&gt;Resource files have changed format and old ones are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;LSet&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;RSet&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;UDTs are &lt;strong&gt;not&lt;/strong&gt; &lt;em&gt;Type&lt;/em&gt;s, but are called Structures instead. 
&lt;/li&gt;&lt;li&gt;UDTs are &lt;strong&gt;not&lt;/strong&gt; by default contiguous blocks of memory, but are objects. 

&lt;/li&gt;&lt;li&gt;&lt;em&gt;Enum&lt;/em&gt;s will &lt;strong&gt;not&lt;/strong&gt; be recognized unless fully-qualified. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;While/Wend&lt;/em&gt; loops are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;GoSub/Return&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;On/GoTo&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;On/GoSub&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Line numbers are &lt;strong&gt;not&lt;/strong&gt; supported. Labels may be numeric. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Erl&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;MsgBox&lt;/em&gt; function is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;DoEvents&lt;/em&gt; function is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;Date&lt;/em&gt; statement is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;Time&lt;/em&gt; statement is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;strike&gt;&lt;em&gt;And&lt;/em&gt;, &lt;em&gt;Or&lt;/em&gt;, &lt;em&gt;XOr&lt;/em&gt;, and &lt;em&gt;Not&lt;/em&gt; are &lt;strong&gt;not&lt;/strong&gt; 
bitwise operators.&lt;/strike&gt; &lt;font color="#c00000"&gt;(Addressed in Beta2)&lt;/font&gt; 
&lt;/li&gt;&lt;li&gt;&lt;strike&gt;Comparison operators are &lt;strong&gt;not&lt;/strong&gt; evaluated before logical 
operators.&lt;/strike&gt; &lt;font color="#c00000"&gt;(Addressed in Beta2)&lt;/font&gt; 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Sqr&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Sgn&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Atn&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;String&lt;/em&gt; function is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Control arrays are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The native &lt;em&gt;Forms&lt;/em&gt; collection is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;UnloadMode&lt;/em&gt; detection is &lt;strong&gt;not&lt;/strong&gt; offered, as QueryUnload is 
history. 
&lt;/li&gt;&lt;li&gt;ListBox controls do &lt;strong&gt;not&lt;/strong&gt; offer an &lt;em&gt;ItemData&lt;/em&gt; property. 
&lt;/li&gt;&lt;li&gt;ListBox controls do &lt;strong&gt;not&lt;/strong&gt; offer an &lt;em&gt;NewIndex&lt;/em&gt; property. 
&lt;/li&gt;&lt;li&gt;Windowless controls are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Image controls are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Shape controls are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Line controls are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;OLE Container controls are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Label controls will &lt;strong&gt;not&lt;/strong&gt; have a &lt;em&gt;Caption&lt;/em&gt; property. 
&lt;/li&gt;&lt;li&gt;&lt;strike&gt;The &lt;em&gt;Tag&lt;/em&gt; property is &lt;strong&gt;not&lt;/strong&gt; supported.&lt;/strike&gt; &lt;font color="#c00000"&gt;(Addressed in Beta2)&lt;/font&gt; 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;ToolTipText&lt;/em&gt; property is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;TextHeight&lt;/em&gt; property is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The &lt;em&gt;TextWidth&lt;/em&gt; property is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Setting a Timer control&amp;#39;s &lt;em&gt;Interval&lt;/em&gt; to 0 does &lt;strong&gt;not&lt;/strong&gt; disable it. 
&lt;/li&gt;&lt;li&gt;Top-level menus may &lt;strong&gt;not&lt;/strong&gt; be used as context menus. 
&lt;/li&gt;&lt;li&gt;Old forms using vbPixels for Scalemode will &lt;strong&gt;not&lt;/strong&gt; upgrade correctly. 
&lt;/li&gt;&lt;li&gt;DDE is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Circle&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Cls&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Line&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;PSet&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Point&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;AutoRedraw&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;PrintForm&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Scale&lt;/em&gt; is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;&lt;strike&gt;The &lt;em&gt;Name&lt;/em&gt; property for forms and controls is &lt;strong&gt;not&lt;/strong&gt; 
exposed at runtime.&lt;/strike&gt; &lt;font color="#c00000"&gt;(Addressed in Beta2)&lt;/font&gt; 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Print&lt;/em&gt; will &lt;strong&gt;not&lt;/strong&gt; include a linefeed at the end of a line. 
&lt;/li&gt;&lt;li&gt;File I/O will &lt;strong&gt;not&lt;/strong&gt; be compatible, at all, and must be rewritten. 
&lt;/li&gt;&lt;li&gt;Printer object methods are &lt;strong&gt;not&lt;/strong&gt; automatically upgraded and must be 
rewritten. 
&lt;/li&gt;&lt;li&gt;Clipboard object methods are &lt;strong&gt;not&lt;/strong&gt; automatically upgraded and must be 
rewritten. 
&lt;/li&gt;&lt;li&gt;The Err object is &lt;strong&gt;not&lt;/strong&gt; shared between managed (.NET) and unmanaged 
(ActiveX) code. 
&lt;/li&gt;&lt;li&gt;The App object is &lt;strong&gt;not&lt;/strong&gt; shared between managed (.NET) and unmanaged 
(ActiveX) code. 
&lt;/li&gt;&lt;li&gt;&lt;em&gt;Screen.MousePointer&lt;/em&gt; does &lt;strong&gt;not&lt;/strong&gt; have a direct replacement. 
&lt;/li&gt;&lt;li&gt;Webclasses are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;DHTML projects are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;UserControl projects are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;ActiveX Document projects are &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The IDE Extensibility Model is &lt;strong&gt;not&lt;/strong&gt; backwardly compatible. 
&lt;/li&gt;&lt;li&gt;Run-&amp;gt;Break-&amp;gt;Edit-&amp;gt;Continue development is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;The Immediate window will &lt;strong&gt;not&lt;/strong&gt; work in Design mode. 
&lt;/li&gt;&lt;li&gt;SDI will &lt;strong&gt;not&lt;/strong&gt; be an option in the IDE -- MDI or nothing. 
&lt;/li&gt;&lt;li&gt;Debug.Print is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Debug.Assert is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Data binding with DAO is &lt;strong&gt;not&lt;/strong&gt; supported. 
&lt;/li&gt;&lt;li&gt;Data binding with RDO is &lt;strong&gt;not&lt;/strong&gt; supported. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This post will also serve as a table of contents; links will be updated on the list for items that are discussed.&lt;/p&gt;&lt;img src="http://addressof.com/aggbug.aspx?PostID=746726" width="1" height="1"&gt;</description><category domain="http://addressof.com/blog/archive/tags/VB6/default.aspx">VB6</category></item></channel></rss>