# Silly VB question

**URL:** <https://boards.straightdope.com/t/silly-vb-question/120677>\
**Category:** Factual Questions\
**Created:** [July 25, 2002, 1:31am UTC](https://boards.straightdope.com/t/silly-vb-question/120677 "2002-07-25T01:31:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![High\_Deity](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@High\_Deity](https://boards.straightdope.com/u/High_Deity)\
**Post date:** [July 25, 2002, 1:31am UTC](https://boards.straightdope.com/t/silly-vb-question/120677/1 "2002-07-25T01:31:05Z")

</div>

Just a syntax question, since I don’t have MSDN or a book to reference, and I figure one of you peoples must know this:

I want to declare an array of strings. How would I do so? The strings are going to be static and hard-coded.

for instance, say the words are “dog”, “cat”, “fish”, “horse”, and “goat”:

I would want array[0] to be “dog”  
array[1] to be “cat”  
array[2] to be “fish”  
array[3] to be “horse”

I don’t even know if VB arrays start on 1 or 0.

Thanks for your help, my mind is in a C gutter.

---

<div class="post-metadata">

**Author:** ![Horseflesh](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/horseflesh/32/7502_2.png) [@Horseflesh](https://boards.straightdope.com/u/Horseflesh)\
**Post date:** [July 25, 2002, 2:25am UTC](https://boards.straightdope.com/t/silly-vb-question/120677/2 "2002-07-25T02:25:32Z")

</div>

Quick way: use the Array function.

Example:

Dim SillyArray(4)  
SillyArray = Array(“dog”,“cat”,“fish”,“horse”,“goat”)

This will populate your array with SillArray(0) = “dog”…SillyArray(4) = “goat”.

Array subscripts by default start with 0. You can declare a different starting and ending subscript by using lower and upper bounds in the Dim statement.

Dim SillyArray(5 to 9) as String
