Array Problem

Results 1 to 2 of 2

Thread: Array Problem

  1. #1
    Duc Guest

    Default Array Problem

    Hi,<BR>I am trying to create a two dimensional array like this<BR>NumberOfField = 4<BR>NumberOfRecord = 2<BR><BR>Redim Array(NumberOfRecord , NumberOfField)<BR>I got the message say.<BR><BR>Error Type:<BR>Microsoft VBScript runtime (0x800A01F5)<BR>Illegal assignment: &#039;Array&#039;<BR><BR>Anyone have any idea why?<BR><BR>Thanks,<BR>Duc

  2. #2
    Join Date
    Dec 1969

    Default RE: Array Problem

    (1) You must first DIM the variable to an empty array.<BR><BR>(2) Array is a keyword in VBScript and so you can NOT use it as the name of a variable.<BR><BR>SO:<BR><BR>&#060;%<BR>Dim myArray( )<BR>ReDim myArray(NumberOfRecord , NumberOfField)<BR>%&#062;<BR><BR>HOWEVER...<BR><BR >It looks to me like you are doing this so you can convert a RecordSet into a two dimensional array. Is that what you are doing? If so... <BR><BR>STOP NOW! Go learn about ADODB.RecordSet.GetRows( )!!!<BR><BR>The GetRows method will convert the recordset into an array in ONE single VBScript statement!<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