Error CS1010: Newline in constant

Bug reports.
tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Error CS1010: Newline in constant

Post by tsyingling » Mon Aug 23, 2010 8:04 pm

Getting this when building a solution. Using a recording to validate text on a form that has labels with return characters. Recording runs fine, error only on build. Appears recording is putting in hard returns into the text in the recording.cs file instead of the "\r" that it uses for keyed text which builds without error. I'm thinking I can use the user code.cs file and simply replace the return characters with the \r but I was just curious if there's something I could do to maybe ignore/correct the error as it exists?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Error CS1010: Newline in constant

Post by Support Team » Mon Aug 23, 2010 8:23 pm

Could you please post the recording (*.rxrec file) that causes this error?
And please post the Ranorex version you use! Thanks!

Regards,
Alex
Ranorex Team

tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Re: Error CS1010: Newline in constant

Post by tsyingling » Mon Aug 23, 2010 8:46 pm

Ranorex version is 2.3.1.8466. Recording is attached. First place where the build errors are happening are line 126. You'll see text for "Does not open eyes" with a return character b/w not and open. I tried to attach the cs file as well so you could see how the recording is writing to the file but I think I hit the attachment size limit. I was looking through some of my other stuff to see if I've run into this before but the only text I've worked with that had return characters that I've been able to find so far has been text I've entered and as I wrote before that always seems to write to the cs file using the \r syntax. Thanks.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Error CS1010: Newline in constant

Post by Support Team » Tue Aug 24, 2010 12:43 pm

I could successfully reproduce that error when a string value contained the Unicode line separator character (U+2028). The bug fix that escapes such characters in the generated code will be included in Ranorex version 2.3.4, which will be released this week.

Regards,
Alex
Ranorex Team

tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Re: Error CS1010: Newline in constant

Post by tsyingling » Tue Aug 24, 2010 3:04 pm

Thanks for looking at this, Alex. I'll keep an eye out for the update.