New answers tagged

3

In your situation, I would probably write a few small utility programs that can iterate though your stored source code and list which programs reference which dlls. For example, in VB6, the .vbp file lists which dlls are used: Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation ...


1

You can use a Do loop to perform the same task: Do myCollection.RemoveAt(MaxCount) Loop Until myCollection.Count = MaxCount This will remove individual collection elements at your maximum count value. There is also a Do ... Loop While variation of the loop. You can find out more about VB's loop structures here.


4

Since lists grow and shrink from their end, you can easily solve the problem by simply looping over the list in reverse order. For i = Node.Nodes.Count-1 To 0 Step -1 If SomeCondition Then Node.Nodes.RemoveAt(i) End If Next i


5

First note: I agree this should probably be a class. For a struct, though: Is it possible to change the design? In LimitedString's case, it sounds like 0 is perfectly fine: a string with no characters. You can't enforce anything with a default constructor (like you suggested in #1) because structs (in C#) cannot contain explicit parameterless constructors. ...


4

Unless you have a really, really good reason that this has to remain a Struct, I would recommend that you convert it to a Class. That way, initialisation is completely under your control, through the Constructor(s) of that Class. If you really can't convert it, then I'd suggest creating a Factory Class to "construct" instances of this Struct; that class ...



Top 50 recent answers are included