0

I am trying to create an empty collection in VBS for xDX Designer. How do I create a collection object from scratch? I'm not interested in a dictionary, which is what I'm seeing others suggesting people use when I search the Internet.

Edit: To the down-voters and people saying another topic answers my question, I am asking a different, though directly-related, question than that topic. A person might not know they are looking for a "list" (not a VBS object/type), as asked about in that question. In my case, I only knew I wanted a Collection). The answer is contained in that other topic, but that question/answer doesn't show up when you search for my question. This is a legitimate new question, though an answer can be found elsewhere in another line of questioning.

M J
  • 98
  • 1
  • 13
  • 2
    Define what you mean by a "collection". Maybe an [`ArrayList`](https://stackoverflow.com/a/13587976/4934172) would work for you? – 41686d6564 stands w. Palestine Sep 26 '18 at 19:01
  • Answered my question before I saw your comment. Yes, as it turns out, I was able to determine that I needed more detail, and that I wanted to work with an ArrayList. – M J Sep 26 '18 at 22:38
  • @Ahmed, you marked this as a duplicate, but you couldn't actually get to the other question/answer by searching for my question. – M J Oct 16 '18 at 17:04
  • 1
    There's nothing wrong with your question being marked as duplicate (especially if you couldn't find the other question(s) by searching for the keywords you had at that moment). Actually, that's the main reason why most duplicate questions don't get deleted; because _["they can serve as a signpost, directing users to useful answers on another question"](https://stackoverflow.com/help/privileges/moderator-tools)_. So, if someone had the same start point as you and they landed at your question, they would be able to find the other answers, and that's the whole point of marking a question as dup. – 41686d6564 stands w. Palestine Oct 16 '18 at 23:51
  • Obviously, the above only applies to cases where you do enough research and still can't find what you're looking for. Asking for something that is very easy to be found with minimal research will most likely be downvoted, closed as duplicate, and end up being deleted. – 41686d6564 stands w. Palestine Oct 16 '18 at 23:57
  • Thanks for the clarification on marking as a duplicate, and being a "signpost". – M J Oct 17 '18 at 14:54

1 Answers1

0

I did more research and found out that "Collection" is not enough detail, and that there are several classes of Collection. What I'm used to dealing with are of the ArrayList class, and that's what I'm looking for. So, one answer is:

Dim objColl
Set ojbColl = CreateObject("System.Collections.ArrayList")
M J
  • 98
  • 1
  • 13
  • This has already been [answered](https://stackoverflow.com/a/13587976/692942) in a previous question. – user692942 Sep 27 '18 at 07:16
  • Sort of, except it is a different originating question. I knew I wanted to work with a Collection, which is a different starting point than knowing you want to work with a "list". That previous question (and answers) to not show up when looking for my question. – M J Oct 01 '18 at 15:01