Expected end of statement ?!?

E

e_x

Hi! I'm trying to work out a pc of code and I can't seem to get it right. I
keep getting the same error:-

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/admin/product.asp, line 236

if currRate1<>0 AND currSymbol1<>"" then response.write "<font size
=""1""><font color =""#ff0000""><span id=""pricediv1c" & Count & """
name=""pricediv1c" & Count & """>" & FormatNumber(rs("pPrice")*currRate1,
checkDPs(currSymbol1)) & " <b>" & currSymbol1 & "</b></span>" &
currencyseparator"</font></font>"


Can anyone spot my mistake?

Thanks.
 
B

Bob Lehmann

What you posted is too mangled to read, but you need an End If in there
somewhere.

Bob Lehmann
 
E

e_x

Sorry, I'll try and clear it a bit.

The error occurs when I added <font size =""1""><font color =""#ff0000"">
and "</font></font>" into the beginning and end of the line. I've marked
where this line is in the code below with --->. I'm not too good with
coding. Hope you can help.


<% if noprice=true then
response.write " "
else
if cDbl(rs("pListPrice"))<>0.0 then response.write
Replace(xxListPrice, "%s",
FormatEuroCurrency(rs("pListPrice"))) & "<BR>"
if cDbl(rs("pPrice"))=0 AND pricezeromessage<>"" then
response.write pricezeromessage
else
response.write "<b>" & xxPrice & ":</b> <span class=""price""
id=""pricediv" & Count & """ name=""pricediv" & Count & """>"
&
FormatEuroCurrency(rs("pPrice")) & "</span> "

if showtaxinclusive=true AND (rs("pExemptions") AND 2)<>2 then
response.write Replace(ssIncTax,"%s", "<span id=""pricedivti"
& Count
& """ name=""pricedivti" & Count & """>" &
FormatEuroCurrency(rs
("pPrice")+(rs("pPrice")*countryTax/100.0)) & "</span> ")

response.write "<br>"

if currencyseparator="" then currencyseparator=" "

---> if currRate1<>0 AND currSymbol1<>"" then response.write "<font
size
=""1""><font color =""#ff0000""><span id=""pricediv1c" &
Count & """
name=""pricediv1c" & Count & """>" & FormatNumber(rs("pPrice")
*currRate1, checkDPs(currSymbol1)) & " <b>" & currSymbol1
& "</b></span>" & currencyseparator"</font></font>"

if currRate2<>0 AND currSymbol2<>"" then response.write "<span
id=""pricediv2c" & Count & """ name=""pricediv2c" & Count &
""">" &
FormatNumber(rs("pPrice")*currRate2, checkDPs(currSymbol2)) &
"
<b>" & currSymbol2 & "</b></span>" & currencyseparator

if currRate3<>0 AND currSymbol3<>"" then response.write "<span
id=""pricediv3c" & Count & """ name=""pricediv3c" & Count &
""">" &
FormatNumber(rs("pPrice")*currRate3, checkDPs(currSymbol3)) &
"
<b>" & currSymbol3 & "</b></span>"

end if

end if %>
 
E

e_x

ok...after posting it, it still looks messy. I'll try again.

<% if noprice=true then
response.write " "
else
if cDbl(rs("pListPrice"))<>0.0
then response.write Replace
(xxListPrice, "%s", FormatEuroCurrency(rs("pListPrice")))
& "<BR>"
if cDbl(rs("pPrice"))=0 AND pricezeromessage<>"" then
response.write pricezeromessage
else
response.write "<b>" & xxPrice & ":</b>
<span class=""price""id=""pricediv" & Count & "
"" name=""pricediv" & Count & """>"
& FormatEuroCurrency(rs("pPrice")) & "</span> "

if showtaxinclusive=true AND (rs("pExemptions")
AND 2)<>2
then response.write Replace(ssIncTax,"%s",
"<span id=""pricedivti" & Count & """ name=""pricedivti"
& Count & """>" & FormatEuroCurrency(rs("pPrice")
+(rs("pPrice")*countryTax/100.0)) & "</span> ")

response.write "<br>"

if currencyseparator="" then currencyseparator=" "

---> if currRate1<>0 AND currSymbol1<>""
then response.write "<font size=""1"">
<font color =""#ff0000""><span id=""pricediv1c" &
Count & """name=""pricediv1c" & Count & """>" &
FormatNumber(rs("pPrice")*currRate1,
checkDPs(currSymbol1)) & " <b>" & currSymbol1
& "</b></span>" & currencyseparator"</font></font>"

if currRate2<>0 AND currSymbol2<>""
then response.write "<span
id=""pricediv2c" & Count & """ name=""pricediv2c" &
Count & """>" & FormatNumber(rs("pPrice")*currRate2, checkDPs
(currSymbol2)) & " <b>" & currSymbol2 & "</b></span>"
& currencyseparator

if currRate3<>0 AND currSymbol3<>""
then response.write "<span
id=""pricediv3c" & Count & """ name=""pricediv3c" &
Count & """>" & FormatNumber(rs("pPrice")*currRate3, checkDPs
(currSymbol3)) & " <b>" & currSymbol3 & "</b></span>"

end if

end if %>
 
B

Bob Lehmann

You have 7 "if...then" statements and only 2 "end if" statements.

What I do, when I have control structrures, is type the beginning and ending
statements of the blocks first, and then fill in the code in between.

So, my process goes something like this....

1.
If 3 = 2 then
else
end if

2.
If 3 = 2 then
Response.Write "That's just crazy!"
else
Response.Write "Well, duh!"
end if

I can't tell because of wrapping in the nesreader, but if you're using the
allowed one-line "if... then" well, That's just crazy!

Properly indenting your code will also help keep track of complex control
structures.

Bob Lehmann
 
M

MD Websunlimited

From what I can tell you're missing the end if statement


--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 Released Special Pricing
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
 
E

e_x

ok. I'll try again. Thanks.

Bob Lehmann said:
You have 7 "if...then" statements and only 2 "end if" statements.

What I do, when I have control structrures, is type the beginning and ending
statements of the blocks first, and then fill in the code in between.

So, my process goes something like this....

1.
If 3 = 2 then
else
end if

2.
If 3 = 2 then
Response.Write "That's just crazy!"
else
Response.Write "Well, duh!"
end if

I can't tell because of wrapping in the nesreader, but if you're using the
allowed one-line "if... then" well, That's just crazy!

Properly indenting your code will also help keep track of complex control
structures.

Bob Lehmann
 

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

Top