Solved

Help with syntax

Posted on 2013-12-02
7
242 Views
Last Modified: 2013-12-02
As part of a stored procedure I have this part of the code which is giving me issues. This is in an ASP/Javascript page:

-- code

var Cmdaddtocaselog__Actdetails = "0";
if(String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"))) != "undefined"){ Cmdaddtocaselog__Actdetails = String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"));}

--  error

Microsoft JScript compilation error '800a03ea'

Syntax error

/bluedot/Intranet/Cases/Comments/e-commentemailing.asp, line 281

if(String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"))) != "undefined"){ Cmdaddtocaselog__Actdetails = String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"));}
-----------------------------------------------------------------------------------------------------------------------------------------------^
0
Comment
Question by:amucinobluedot
  • 3
  • 2
  • 2
7 Comments
 
LVL 7

Expert Comment

by:dimmergeek
ID: 39690514
I think you have one too many closing parens in your if (test)
0
 

Author Comment

by:amucinobluedot
ID: 39690519
Can you tell which ones ?
0
 
LVL 7

Accepted Solution

by:
dimmergeek earned 500 total points
ID: 39690522
try
if(String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message")) != "undefined"){ Cmdaddtocaselog__Actdetails = String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"));}

Open in new window

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:amucinobluedot
ID: 39690527
Perfect, thanks !
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39690528
you had an extra ")". I also re-wrote it for better readibility

var commentToEmail = String( "Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message") )

if ( commentToEmail  != "undefined") {

Cmdaddtocaselog__Actdetails = String( "Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message") );

}
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39690530
beat me to it :)
0
 
LVL 7

Expert Comment

by:dimmergeek
ID: 39690537
Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question about ASP Including Files 6 44
sql query help 2 46
My Query is not giving correct result. Please help 5 32
Join multiple pivot queries 2 9
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now