Getting Scripting Error...not sure why

Any template questions or comments or suggestions

Getting Scripting Error...not sure why

Postby j-oz on Mon Oct 29, 2007 1:22 pm

Hi,

I am getting the following error a Scripting Error with the following Error Text:
) expected

This is happening on the following line of code:
output.writeln( \"\\t\\t[DataMember(Name = \"\"\" + fieldAccessor + \"\"\", IsRequired = true)]\" );

Can anyone tell me why this is happening? fieldAccessor is a variable string.

here is an example of output I want:
[DataMember(Name = \"SysOfRecCd\", IsRequired = true)]

Thanks in advance!
j-oz
Lurker
 
Posts: 2
Joined: Mon Oct 29, 2007 1:17 pm

Postby mgnoonan on Mon Oct 29, 2007 1:51 pm

What script language is your template written in? If it is VBScript, take the semi-colon off the end of the line.
Matt Noonan
EasyObjects.NET - The O/RM for the Enterprise Library
http://www.easyobjects.net
User avatar
mgnoonan
Expert
 
Posts: 1019
Joined: Tue Sep 14, 2004 3:17 am
Location: Springboro, OH

Postby j-oz on Mon Oct 29, 2007 2:00 pm

Sorry, I forgot to mention that it is C#.
j-oz
Lurker
 
Posts: 2
Joined: Mon Oct 29, 2007 1:17 pm

Postby mgnoonan on Mon Oct 29, 2007 2:56 pm

Then you are not properly escaping your double-quotes:

Code: Select all
output.writeln( \"\\t\\t[DataMember(Name = \\\"\" + fieldAccessor + \"\\\", IsRequired = true)]\" );
Matt Noonan
EasyObjects.NET - The O/RM for the Enterprise Library
http://www.easyobjects.net
User avatar
mgnoonan
Expert
 
Posts: 1019
Joined: Tue Sep 14, 2004 3:17 am
Location: Springboro, OH


Return to General Template Questions/Comments

Who is online

Users browsing this forum: No registered users and 1 guest

cron