Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Syntax Error


Message #1 by "Judy Sese" <jmss66@y...> on Fri, 9 Aug 2002 18:54:49
I am getting a Syntax error on the following code. It starts on my "If" 
statement. Can someone please give me the right syntax for what I am 
trying to do. I just want to display the header "As of Pay Period" when 
the status is not = "R". 

   Response.Write _
	"<TABLE BORDER=""1"" CELLSPACING=""3"" CELLPADDING=""3"">" & _
	"   <TR>" & _
	"	<TH>SSN</TH>" & _
        if strStatus <> "R" Then 
	"	<TH>As of Pay Period</TH>" & _  
	End If
	"	<TH>Drop Balance</TH>" & _
	"	<TH>Total Contribution</TH>" & _
	"	<TH>Pension Entrance Date</TH>" & _
	"	<TH>DROP Entrance Date</TH>" & _
	"</TR>"
Thanks,
Judy
Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Fri, 9 Aug 2002 14:14:02 -0400
Hi Judy,

My first suggestion would be to do a Response.Write for each line instead of
using the line continuation character.  This causes the array to be resized
over and over again, and is considered a costly (slower) process.  Below is
my suggestion, which corrects the problem.

   Response.Write	"<TABLE BORDER=""1"" CELLSPACING=""3""
CELLPADDING=""3"">"
   Response.Write	"   <TR>"
   Response.Write	"	<TH>SSN</TH>"
   if strStatus <> "R" Then 
   Response.Write	"	<TH>As of Pay Period</TH>"
   End If
   Response.Write	"	<TH>Drop Balance</TH>"
   Response.Write	"	<TH>Total Contribution</TH>"
   Response.Write	"	<TH>Pension Entrance Date</TH>"
   Response.Write	"	<TH>DROP Entrance Date</TH>"
   Response.Write	"</TR>"

Regards,
Peter


> -----Original Message-----
> From: Judy Sese [mailto:jmss66@y...]
> Sent: Friday, August 09, 2002 6:55 PM
> To: ASP Databases
> Subject: [asp_databases] Syntax Error
> 
> 
> I am getting a Syntax error on the following code. It starts 
> on my "If" 
> statement. Can someone please give me the right syntax for what I am 
> trying to do. I just want to display the header "As of Pay 
> Period" when 
> the status is not = "R". 
> 
>    Response.Write _
> 	"<TABLE BORDER=""1"" CELLSPACING=""3"" CELLPADDING=""3"">" & _
> 	"   <TR>" & _
> 	"	<TH>SSN</TH>" & _
>         if strStatus <> "R" Then 
> 	"	<TH>As of Pay Period</TH>" & _  
> 	End If
> 	"	<TH>Drop Balance</TH>" & _
> 	"	<TH>Total Contribution</TH>" & _
> 	"	<TH>Pension Entrance Date</TH>" & _
> 	"	<TH>DROP Entrance Date</TH>" & _
> 	"</TR>"
> Thanks,
> Judy
> 

  Return to Index