define an array anyone??

Results 1 to 4 of 4

Thread: define an array anyone??

  1. #1
    Linda Lu Guest

    Default define an array anyone??

    I&#039;m new to asp. Can someone tell me how to define & display an array in asp? Do you know where I can resources for this?<BR>Thanks-

  2. #2
    Bill H. Guest

    Default RE: define an array anyone??

    Dim arrValues<BR>ReDim arrValues(50)<BR><BR>Defines an array of 50...

  3. #3
    Linda Guest

    Default RE: define an array anyone??

    And how do you display an array?? Thanks again!

  4. #4
    Join Date
    Dec 1969

    Default RE: define an array anyone??

    To define a statically sized array, simply:<BR><BR>Dim arrayName(20)<BR><BR>You can never change the size of such an array. <BR><BR>To define a dynamically size array:<BR><BR>Dim arrayName()<BR>ReDim arrayName( anyPositiveAritmeticExpression )<BR><BR>To display an array:<BR><BR>You can&#039;t. Not directly. You have to write your own *loop* to do so. Such as:<BR><BR>For i = 0 To UBound( arrayName )<BR>&nbsp; &nbsp; Response.Write "element " & i & " of the array has value " & arrayName(i) & "&lt;br&#062;"<BR>Next<BR><BR>And where do you find resources? It might be easier to answer "Where do you *not* find resources?" *ANY* of the good ASP help sites have resources on arrays (look at the ASPFAQs -- link at top right of this page -- for this site, just for *one* simple example). Maybe it is time to get a *good* ASP book???<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