A Little Weirdness in VB.net 2010, Followup

I figured out the problem with the routine/variables in the previous post. The issue was that StringToBreak was being passed as ByRef when it didn’t need to be. Changing it back to ByVal fixed things.

Basically, the calling routine was passing the same variable to StringToBreak and PreCompare. Because both were ByRef, this made those two variables actually aliases to the same memory location, and assigning PreCompare the results of Left() also made StringToBreak appear truncated.

Mystery solved.

Still no idea on the weirdness related to my custom collection becoming a normal collection when using Implements IEnumerable.

Armin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.