Solved

Help with syntax

Posted on 2013-12-02
7
250 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

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

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 33

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

785 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