# How does the VB6 AI Migrator handle VB6 Collections?

VB6 Collections could be indexed with either a string key (HashTable-style) or an integer (ArrayList-style).

In .NET, we have HashTables that can be indexed with a key and ArrayLists that can be indexed with integers, but we don't have this "hybrid" class that can have both types of access.

When you migrate, the VB6 AI Migrator can detect the way in which you are accessing Collections in your code, and based on that, it infers the appropriate replacement. However, for this inference to work correctly in all cases, the usage of each Collection in VB6 must be very uniform and consistent throughout the code (i.e. you can't mix ArrayList-like and HashTable-like access on the same instance of a Collection). Furthermore, if a VB6 Collection contains only String objects, the VB6 AI Migrator may convert that collection to the .NET StringCollection class (for ArrayList-like access) or to the .NET StringDictionary class (for HashTable-like access).

This is a good alternative to the backward compatibility VB6.Collection class (the default conversion for Collections in the VB6 AI Migrator), but may lead to numerous manual changes if the usage of Collections in the VB6 source code is not uniform.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gapvelocity.ai/vbuc/knowledge-base/faq/how-does-the-vb6-ai-migrator-handle-vb6-collections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
