Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with syntax

Posted on 2013-12-02
7
Medium Priority
?
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

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

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 34

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

636 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