Solved

Help with syntax

Posted on 2013-12-02
7
260 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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

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.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

856 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