Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Type Mismatch Error...HELP!!!!!!!!

  • 17-09-2007 11:40am
    #1
    Registered Users Posts: 224 ✭✭


    Hi All,

    Im receiving the following error and am in urgent need to get rid of it. I have tried everything and think it maybe down to my regional settings. Its an ASP driven site and I have it on a test server and an actual server. Its working perfectly on the test server but not on the live server. the mismatch refers to an array being generated. I have matched the settings on both servers and Regional Settings in the control panel. Is there anywhere else i need to change to get them identical?


    Microsoft VBScript runtime error '800a000d'

    Type mismatch: 'arCartDesc'

    /sqs/uk/functionsuk.asp, line 622


Comments

  • Registered Users Posts: 706 ✭✭✭DJB


    what happens on line 622? post up that line of code. It's most likely you are trying to do a calculation on a string or something like that.


  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    I have highlighted in Red line 622

    Function getCartInfo (InfoName)
    ' returns array offset for a given Cart piece of info
    ' returns -1 if not found
    dim iPosition
    dim iLoop

    arCartDesc = Session("soCartDescription")
    iLoop = 0
    iPosition = -2

    do while iPosition = -2
    if iLoop <= 18 then if arCartDesc(iLoop) = InfoName then
    iPosition = iLoop
    end if
    iLoop = iLoop + 1
    else
    ' no item - return error
    iPosition = -1
    end if
    Loop
    getCartInfo = iPosition

    End Function


  • Registered Users Posts: 706 ✭✭✭DJB


    you haven't made arCartDesc an array. You need to split it with a delimiter, e.g.

    arCartDesc = Split(Session("soCartDescription"),",")

    where "," indicates the delimiter.

    I think! Try and let me know.


  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    Ok, cheers for that. Made that change and am getting a different error now. The errors related to the light highlighted

    Microsoft VBScript runtime error '800a0009'

    Subscript out of range: 'iLoop'

    /sqs/ie/functions.asp, line 516


    Function getCartInfo (InfoName)
    ' returns array offset for a given Cart piece of info
    ' returns -1 if not found
    dim iPosition
    dim iLoop

    arCartDesc = Split(Session("soCartDescription"),",")
    iLoop = 0
    iPosition = -2

    do while iPosition = -2
    if iLoop <= 18 then
    if arCartDesc(iLoop) = InfoName then
    iPosition = iLoop
    end if
    iLoop = iLoop + 1
    else
    ' no item - return error
    iPosition = -1
    end if
    Loop
    getCartInfo = iPosition

    End Function


  • Registered Users Posts: 706 ✭✭✭DJB


    That error means that, for example, you are looking for the 19th item in the array and you only have 18.

    Best thing to do is put this just after your dim iLoop:

    response.write Session("soCartDescription")
    response.end

    Copy and paste what is outputted so I can see what data you are playing with.


  • Advertisement
  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    That actually brought back a blank page. This is how i coded it. Did i d it wrong?

    Function getCartInfo (InfoName)
    ' returns array offset for a given Cart piece of info
    ' returns -1 if not found
    dim iPosition
    dim iLoop

    response.write Session("soCartDescription")
    response.end

    arCartDesc = Split(Session("soCartDescription"),",")
    iLoop = 0
    iPosition = -2

    do while iPosition = -2
    if iLoop <= 18 then
    if arCartDesc(iLoop) = InfoName then
    iPosition = iLoop
    end if
    iLoop = iLoop + 1
    else
    ' no item - return error
    iPosition = -1
    end if
    Loop
    getCartInfo = iPosition

    End Function


  • Registered Users Posts: 706 ✭✭✭DJB


    No you didn't. There was nothing in Session("soCartDescription"). This is where your problem lies. How is that value populated? Is this code you wrote yourself or off the shelf software?


  • Registered Users Posts: 2,781 ✭✭✭amen


    as this is server side you could debug it and inspect the variables


Advertisement