Monthly Archives: January 2012

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