home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 3039
Discussions: 188,378, Posts: 2,243,447, Members: 232,605
Old October 20th, 2008, 08:11 PM     #21 (permalink)
Junior Member
 
Join Date: Oct 2008
Posts: 17
This is what I have:
Code:
<%
CONST CC_ProductID = 0
CONST CC_Quantity = 1
CONST CC_Name = 2
CONST CC_Price = 3
CONST CC_UniqueKey = 4
CONST CC_Weight = 5
CONST CC_Color = 6
CONST CC_Size = 7
CONST CC_Skew = 8
if Request.Cookies("CharonCart") = "" then
dim CCcart(9,50)
else
CCcart=CookieToCart("CharonCart")
end if

CCcart_SubTotal=0
CCcart_numItems=0
CCcart_Shipping=0
CCcart_Discount=0
CCcart_SalesTax=0
isFound=false
for i=0 to ubound(CCart,2)
if CCcart(CC_ProductID,i) <> "" then
isFound=true
CCcart_SubTotal=CCcart_SubTotal + (CCcart(CC_Quantity,i)*CCcart(CC_Price,i))
CCcart_numItems=CCcart_numItems + 1
end if
next
function CCcart_LineTotal
CCcart_LineTotal=CCcart(CC_Quantity,i)*CCcart(CC_Price,i)
end function
function CCcart_GrandTotal
CCcart_GrandTotal=CCcart_SubTotal + CCcart_Shipping + CCcart_SalesTax - CCcart_Discount
end function

function CartToCookie(thearray,cookiename)
mystring=""
for j=0 to ubound(thearray,2)
if thearray(CC_ProductID,j) <> "" then
for i=0 to 9
mystring=mystring & thearray(i,j) & "^"
next
mystring=left(mystring,len(mystring)-1)
mystring=mystring & "|"
end if
next
mystring=left(mystring,len(mystring)-1)
Response.Cookies(cookiename)=mystring
end function

function CookieToCart(cookiename)
dim myarray()
mystring=Request.Cookies(cookiename)
productarray=split(mystring,"|")
for j=0 to ubound(productarray)
itemarray=split(productarray(j),"^")
for i=0 to 9
if itemarray(i) <> "" then
myarray(i,j)=itemarray(i)
else
myarray(i,j)=null
end if
next
next
CookieToCart=myarray
end function
%>
This is the error now:
Error Type: Type Mismatch
/store/inc_CharonCart.asp, line 23


Which is:

for i=0 to ubound(CCcart,2)

Edit: it also does it now whenever I view details.


Last edited by xingxang : October 20th, 2008 at 08:14 PM.
xingxang is offline   Reply With Quote
Old October 21st, 2008, 01:09 PM     #22 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,549
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
Don't know man. I don't have Sun ASP to test anything on and that code is ugly as hell.

I personally would not use that code if you paid me. I imagine it isn't very secure.

Sorry I can't be of more help,
Jkrohn
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.

jkrohn is offline   Reply With Quote
Old October 21st, 2008, 02:00 PM     #23 (permalink)
Junior Member
 
Join Date: Oct 2008
Posts: 17
Quote:
Originally Posted by jkrohn View Post
Don't know man. I don't have Sun ASP to test anything on and that code is ugly as hell.

I personally would not use that code if you paid me. I imagine it isn't very secure.

Sorry I can't be of more help,
Jkrohn
HAhaha. Hey, I appreciate your bearing with my problem as long as you have. And I appreciate your honesty about the code. I'm at the point now where I want to ditch this cart and set up another one. The host (hostgator.com) has agora cart on their server already, you have any shopping cart recommendations?

xingxang is offline   Reply With Quote
Old October 21st, 2008, 04:11 PM     #24 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,549
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
No, I don't do any work in that sector. Someone else may though. Start a new thread so it gets some attention.
jkrohn is offline   Reply With Quote
Old October 21st, 2008, 08:02 PM     #25 (permalink)
Ultimate Member
 
CujoRbd's Avatar
 
Join Date: Oct 2001
Location: Everywhere
Posts: 1,050
if you haven't completely dumped this cart, you may want to look at how you are dimensioning your variables.

I don't know ASP, but in VisualBasic, when you dimension (Dim) a variable without defining the type, it comes in as a Variant, meaning that it can be flexible but the language has to guess. I got type mismatch errors when i tried to Dim vars without giving them a type (particularly if I was working with integers or other number values). What solved it for me was being specific about my variables. That is:
Code:
Dim CCart() as Object
Dim MyArray() As Array
Dim i As Integer
(Or whatever is appropriate)
as opposed to just
Code:
Dim CCart()
Dim MyArray()
Dim i
This way, the language knows how to pass and handle these variables.

just a thought.
CujoRbd is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Type I & Type II Compact Flash - difference? MTAtech Multimedia and Audio 0 July 3rd, 2004 08:48 AM
What type of entertainment are you into? Dj-Icer General Gaming Discussion 12 October 29th, 2003 11:12 AM
What type are you? Warthog IMO Community 23 May 26th, 2003 09:11 AM
How come when I type... DavidES Technical Support 3 November 17th, 2002 12:59 PM
What type are you? ocit IMO Community 28 March 30th, 2002 11:30 PM

Most Active Discussions
Is It Just Me? (2882)
The United States Debt (20)
Looks like Burris will get his Sena.. (7)
I think I just killed my computer w.. (24)
Upgrading RAM (5)
Folderchat Weekday thread (439)
Antec 300 bulk purchase? (11)
Worth the upgrade?? (14)
Titan quest and Immortal Throne, an.. (17)
Recent Discussions
dual monitors wont boot (0)
Folderchat Weekday thread (439)
New Build ( Finally ) (0)
MSN Hotmail Down??? (7)
Help with an Ati Radeon HD 4850.. (23)
Laptop waking up itself (0)
CPU wont boot (3)
Best digital camera for under 2.. (13)
Building first computer, will t.. (2)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 07:59 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28