Microsoft VBScript runtime (0x800A000D) Type mismatch: '[string: "

S

Snow

Hello:

I have Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "2, 0"]'

The error happened at this line: if session("systemIdCount" &
arrSystems(iLoop)) > 0

The code like this:

strSystems = session("strSystems") '' Capture SystemId Array
arrSystems = split(strSystems, ",")

iLoop = 0
For iLoop = LBound(arrSystems) to UBound(arrSystems) '' Start SystemId Array
Loop
arrSystems(iLoop) = Trim(arrSystems(iLoop))
computerCount = computerCount + 1
session("systemId" & arrSystems(iLoop)) = arrSystems(iLoop) '' Define
SystemId Session

if request.querystring("newOrder") = "true" then '' Resets Session if it is
a New Order
session("systemIdCount" & arrSystems(iLoop)) = request("systemIdCount" &
arrSystems(iLoop)) '' Define SystemId Count Session
end if

if session("systemIdCount" & arrSystems(iLoop)) > 0 then '' Check if count
is grater than 0
varSysId = session("systemId" & arrSystems(iLoop))
for varItemNum = 1 to session("systemIdCount" & arrSystems(iLoop)) '
varItemNum Loop
..........

I thought that the error was that session should be int, so add cint to the
this line: if (session("systemIdCount" & arrSystems(iLoop))) > 0 However, I
got mismatch "cint" error.

What am I missing here?

Your help is highly appreciated.
 
L

Larry Bud

Snow said:
Hello:

I have Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "2, 0"]'

The error happened at this line: if session("systemIdCount" &
arrSystems(iLoop)) > 0

The code like this:

strSystems = session("strSystems") '' Capture SystemId Array
arrSystems = split(strSystems, ",")

iLoop = 0
For iLoop = LBound(arrSystems) to UBound(arrSystems) '' Start SystemId Array
Loop
arrSystems(iLoop) = Trim(arrSystems(iLoop))
computerCount = computerCount + 1
session("systemId" & arrSystems(iLoop)) = arrSystems(iLoop) '' Define
SystemId Session

if request.querystring("newOrder") = "true" then '' Resets Session if it is
a New Order
session("systemIdCount" & arrSystems(iLoop)) = request("systemIdCount" &
arrSystems(iLoop)) '' Define SystemId Count Session
end if

if session("systemIdCount" & arrSystems(iLoop)) > 0 then '' Check if count
is grater than 0
varSysId = session("systemId" & arrSystems(iLoop))
for varItemNum = 1 to session("systemIdCount" & arrSystems(iLoop)) '
varItemNum Loop
.........

I thought that the error was that session should be int, so add cint to the
this line: if (session("systemIdCount" & arrSystems(iLoop))) > 0 However, I
got mismatch "cint" error.

What am I missing here?

Put a response.write in giving you the session variable that you're
trying to build

response.write(systemIdCount" & arrSystems(iLoop))

This will tell you the reason for the error.
 
S

Snow

Thanks for help. I put response.write, but there was nothing shown on the page

Larry Bud said:
Hello:

I have Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "2, 0"]'

The error happened at this line: if session("systemIdCount" &
arrSystems(iLoop)) > 0

The code like this:

strSystems = session("strSystems") '' Capture SystemId Array
arrSystems = split(strSystems, ",")

iLoop = 0
For iLoop = LBound(arrSystems) to UBound(arrSystems) '' Start SystemId Array
Loop
arrSystems(iLoop) = Trim(arrSystems(iLoop))
computerCount = computerCount + 1
session("systemId" & arrSystems(iLoop)) = arrSystems(iLoop) '' Define
SystemId Session

if request.querystring("newOrder") = "true" then '' Resets Session if it is
a New Order
session("systemIdCount" & arrSystems(iLoop)) = request("systemIdCount" &
arrSystems(iLoop)) '' Define SystemId Count Session
end if

if session("systemIdCount" & arrSystems(iLoop)) > 0 then '' Check if count
is grater than 0
varSysId = session("systemId" & arrSystems(iLoop))
for varItemNum = 1 to session("systemIdCount" & arrSystems(iLoop)) '
varItemNum Loop
.........

I thought that the error was that session should be int, so add cint to the
this line: if (session("systemIdCount" & arrSystems(iLoop))) > 0 However, I
got mismatch "cint" error.

What am I missing here?

Put a response.write in giving you the session variable that you're
trying to build

response.write(systemIdCount" & arrSystems(iLoop))

This will tell you the reason for the error.
 
F

Firas S Assaad

Hi,
When i used to have this kind of errors in the past, the only result
was putting double quotes at the integer
which you have to replace this line
session("systemIdCount" & arrSystems(iLoop)) > 0

with this
session("systemIdCount" & arrSystems(iLoop)) > "0"

the common reason this error is accuring, is that when you submit
values from two fields with the same name and then retrieve it in your
code, the result will contain a comma.
So when you use the line of code [session("systemIdCount" &
arrSystems(iLoop)) > 0]
what happens is this ["2, 0" > 0]
which cannot be possible because you cant compare string with and
integer
so to bypass this error just put the double quotes and it will be ["2,
0" > "0"]
which means it is comparing string with string, which is possible.

This should solve the problem, but since that error happened, take
advantage of it, and know where you are going wrong.

Hope what i wrote makes sense to you.


Best Regards
Firas S Assaad

Thanks for help. I put response.write, but there was nothing shown on the page



Larry Bud said:
Snow said:
Hello:
I have Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "2, 0"]'
The error happened at this line: if session("systemIdCount" &
arrSystems(iLoop)) > 0
The code like this:
strSystems = session("strSystems") '' Capture SystemId Array
arrSystems = split(strSystems, ",")
iLoop = 0
For iLoop = LBound(arrSystems) to UBound(arrSystems) '' Start SystemId Array
Loop
arrSystems(iLoop) = Trim(arrSystems(iLoop))
computerCount = computerCount + 1
session("systemId" & arrSystems(iLoop)) = arrSystems(iLoop) '' Define
SystemId Session
if request.querystring("newOrder") = "true" then '' Resets Session if it is
a New Order
session("systemIdCount" & arrSystems(iLoop)) = request("systemIdCount" &
arrSystems(iLoop)) '' Define SystemId Count Session
end if
if session("systemIdCount" & arrSystems(iLoop)) > 0 then '' Check if count
is grater than 0
varSysId = session("systemId" & arrSystems(iLoop))
for varItemNum = 1 to session("systemIdCount" & arrSystems(iLoop)) '
varItemNum Loop
.........
I thought that the error was that session should be int, so add cint to the
this line: if (session("systemIdCount" & arrSystems(iLoop))) > 0 However, I
got mismatch "cint" error.
What am I missing here?
Put a response.write in giving you the session variable that you're
trying to build
response.write(systemIdCount" & arrSystems(iLoop))
This will tell you the reason for the error.- Hide quoted text -- Show quoted text -
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top