Error XS0103 The name 'CRLF' does not exist in the current context

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1856
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Error XS0103 The name 'CRLF' does not exist in the current context

Post by ic2 »

This used to work, I last used X# for it somewhere in 2019 and now I get:

Error XS0103 The name 'CRLF' does not exist in the current context

In my notes it said that in Solution/Properties, Language I should set Suppress Standard Header to false. But that is false (unchanged).

What has changed and how do I solve this?

Dick
ic2
Posts: 1856
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Error XS0103 The name 'CRLF' does not exist in the current context

Post by ic2 »

I temporarily solved it by adding:

GLOBAL CRLF := e"/r/n" AS STRING

which I found on Github. But I would still ike to know why it stopped working.

Dick
User avatar
Chris
Posts: 4854
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Error XS0103 The name 'CRLF' does not exist in the current context

Post by Chris »

Hi Dick,

CRLF is now in the runtime, in XSharp.Core.dll. If you had a reference to that it would work.

Previously (long ago) this had been declared as a preprocessor directive indeed in the standard header file (XSharpIncludeXSharpDefs.xh), but this was causing some problems so it as moved into the runtime dll.

Your solution is fine, but better change it to

DEFINE CRLF := e"rn"

so you are sure it is read-only and cannot accidentally modify it in your code.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1856
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Error XS0103 The name 'CRLF' does not exist in the current context

Post by ic2 »

Hello Chris

Thanks. Yes, this program hasn't been touched for a while. The DEFINE works, and it's not a big deal to change CRLF either but from converted VO code there will be a lot of CRLF's to change, so the DEFINE will work "fine".

Dick
Post Reply