Not used to ASP

Discussion in 'ASP General' started by Sonnich Jensen, Sep 13, 2007.

  1. Hi all!

    I am usually working with PHP, rarely with ASP. I have a book for
    help, but that does not do much for me.

    I have an array, like:

    redim Preserve ecode(I+1)
    ecode(I) = field_value(0, rsItem)

    it adds stuff to the array.

    Now, I need to _insert_ items into the array.
    In other words, I need to find an item, say "code C" in the array, and
    then insert "code C-1" right after it.

    I know very well how to do this in PHP, but I dont even know where to
    look for help for ASP.

    Would anyone be so kind to help me out?

    BR
    Sonnich
    Sonnich Jensen, Sep 13, 2007
    #1
    1. Advertising

  2. Sonnich Jensen wrote:
    > Hi all!
    >
    > I am usually working with PHP, rarely with ASP. I have a book for
    > help, but that does not do much for me.
    >
    > I have an array, like:
    >
    > redim Preserve ecode(I+1)
    > ecode(I) = field_value(0, rsItem)
    >
    > it adds stuff to the array.
    >
    > Now, I need to _insert_ items into the array.
    > In other words, I need to find an item, say "code C" in the array, and
    > then insert "code C-1" right after it.
    >
    > I know very well how to do this in PHP, but I dont even know where to
    > look for help for ASP.
    >
    > Would anyone be so kind to help me out?
    >

    First of all, the language you are using is vbscript, not ASP. ASP is a
    "platform" which supports multiple scripting languages, including
    vbscript and jscript.
    You can download the Windows Scripting Host (which includes vbscript)
    documentation from here:
    http://www.microsoft.com/downloads/...48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en
    Vbscript does not support inserting elements into the middle of an
    array.
    If you are tied to using a vbscript array, you have two options:
    1. Create a new array and write the array elements in the order you want
    them
    2. Resize the array, use a loop to move the array element values to the
    desired location and set the desired element value to the value you wish
    to insert.

    This task is a little simpler with an ad hoc ADO recordset: AddNew still
    adds records to the end of the recordset, but you can use Sort to order
    them in any order you want.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Sep 13, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?gb2312?B?ztLDzr2txM+6ww==?=

    asp.net page can not be used in a modal/modeless dialog?

    =?gb2312?B?ztLDzr2txM+6ww==?=, Dec 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    441
    =?gb2312?B?ztLDzr2txM+6ww==?=
    Dec 11, 2003
  2. Casey Hawthorne
    Replies:
    1
    Views:
    699
    Arne Vajhøj
    Mar 18, 2009
  3. Dave

    Secure web services used by ASP & ASP.NET

    Dave, Oct 22, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    109
  4. Bo
    Replies:
    2
    Views:
    170
    Phill. W
    Feb 25, 2005
  5. Ted Byers
    Replies:
    23
    Views:
    411
    Peter J. Holzer
    Nov 15, 2008
Loading...

Share This Page