How do one pass an array to and from a custom messagebox/inputbox?

I'm trying to create a custom messagebox/inputbox where I can enter values into certain fields and then return those values as an array.

However...

The custom messagebox/inputbox must also return a string or integer so I can know whether Ok or Cancel has been selected.

So my thinking was;
  1. Create the array in my form.
  2. Pass that array to the custom messagebox/inputbox form by reference so that changing values in the array will be reflected in the original form after the custom messagebox/inputbox form are closed.
  3. Enter the values into the array in the messagebox/inputbox form.
  4. Return the button clicked as the return value of the custom messagebox/inputbox when the box is closed.


Is this possible? How do I declare/pass the array from one form to another and back again?