Creating an array dynamically

Results 1 to 2 of 2

Thread: Creating an array dynamically

  1. #1
    Join Date
    Dec 1969

    Default Creating an array dynamically

    I need to create an array dynamically. The size of this array depends on how many options a user selects on a form. I have the number of options selected stored in a variable called, countArray. I essentially wish I could create the array doing this:<BR><BR>Dim optionsArray(countArray)<BR><BR>But I know I can&#039t because it demands that an integer be in the I&#039m stuck.<BR><BR>Anyone have suggestions?<BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Creating an array dynamically

    See the VBScript documentation (available via link on left side of this page if you don&#039t already have it on your machine) for the ReDim statement.<BR><BR>Briefly:<BR><BR>Dim theArray( ) &#039 no size given!<BR>...<BR>ReDim theArray( Int(Rnd * 100) ) &#039 *any* expression valid<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts