Results 1 to 2 of 2

Thread: this is going to sound stupid... but

  1. #1

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    How can I add data to an array?
    I tried:
    AI = AI + 1
    MyArray(AI) = MyData
    BTW: I had a loop (that's why the ai).

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>


    'add infor to an array

    Dim myArr()
    Dim i as integer
    For i = 1 to 10
    redim preserve myArr(i)
    myarr(i) = i
    next i

    for i = lbound(myArr) to uBound(myarrr)
    if i = 0 then
    myString = myArr(i)
    else
    myString = myString & ":" & myArr(i)
    endif
    next i
    msgbox mystring
    '
    'or add to item in array
    Dim myArr(2) as integer
    myarr(0) = 1
    myarr(1) = 2
    myarr(2) = 3

    dim i
    for i = lbound(myarr) to ubound(myarr)
    if i = 2 then
    myarr(i) = (myArr(i) + 23)
    endif
    next i

    msgbox myarr(2) 'should be 26
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

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



Click Here to Expand Forum to Full Width