Store Command Line Arguments in An Array

Category:
Lists, Collections and Arrays
Type:
Snippets
Difficulty:
Beginning
Author:
Anantha PAdmanabhan

Version Compatibility:

More information:
I often need to get and store command line arguments. The function given below stores the command line arguments to an array and returns the number of arguments. I have restricted the size of the array to 10 since I know of no case where more than 10 command line arguments are passed. See code comments for more details and an example.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: