The Mighty Dubs Registered User
#1

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

DJB Registered User
#2

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.

The Mighty Dubs Registered User
#3

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

DJB Registered User
#4

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.

The Mighty Dubs Registered User
#5

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

DJB Registered User
#6

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.

The Mighty Dubs Registered User
#7

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

DJB Registered User
#8

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?

amen Registered User
#9

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

Want to share your thoughts?

Login here to discuss!