fbpx

CRLF - does this still work ?

More
1 year 2 months ago #1 by Phil Hepburn
CRLF - does this still work ? was created by Phil Hepburn
Hi Robert,

I am trying to get back into coding and creating session material during the long winter evenings.

I starting my first sample based on the Address Book metaphor, I found that the CRLF did not work - I thought you had it available globally when I did my many months X# stuff early this year.

Does it still work ? Am I doing something silly ?

I am pretty sure that in the VS 2015 version I am using it has been refreshed with the latest X# as well as the zip folder 'copy over'. My VS is not in a virtual machine, just the main PC system.

Any tips ?

Thanks for listening.

Regards,
Phil.
Wales, UK.

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #2 by Chris Pyrgas
Replied by Chris Pyrgas on topic CRLF - does this still work ?
Hi Phil,

What do you mean it does not work? Does the compiler give you an error message?

CRLF is defined in the \Include\XSharpDefs.xh file, as:

#define CRLF e"\r\n"

so it should be globally visible. If for any reason it is not, you can define it easily in your app:

DEFINE CRLF := e"\r\n"

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #3 by Karl Faller
Replied by Karl Faller on topic CRLF - does this still work ?
Chris,
tried it late night, with Xide in a X#console app no problem, with VS17 a "does not exist in current context.
Adding DEFINE CRLF := e"\r\n" solved it - seems, the xh file is not included with this template..

HAND
Karl

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #4 by Chris Pyrgas
Replied by Chris Pyrgas on topic CRLF - does this still work ?
Guys,

Hmm, I think you're right, there seems to be a problem there. Please open the project properties in VS, set the "Build\Suppress standard header file" option to true, save and rebuild, should get the same error. Now set it back to False and Rebuild, does the error go away?

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago - 1 year 2 months ago #5 by Karl Faller
Replied by Karl Faller on topic CRLF - does this still work ?
Chris,
strange - "suppress" was "false", changed to "True", CTRL-S, CRTL-F5 -> works!
Changed back to false: CTRL-S, CRTL-F5 -> XS9002 Parser: mismatched input 'e"\r\n"'
Back to "True" -> works again...

HTH
Karl @VS17 15.0.0 (great, "about" dialog doesn't let you copy version info....)
Last edit: 1 year 2 months ago by Karl Faller. Reason: typo

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #6 by Phil Hepburn
Replied by Phil Hepburn on topic CRLF - does this still work ?
Hi Chris,

Yes, I am well aware that CRLF was available to me globally as you say - it was in all my apps for Cologne 2017. However, when I tried to use it, in a new simple WPF app two days back, I got the following error :-



When I made my own class variable it worked as below, which is not a surprise :S





Now then, my worry is why should this be happening, when it did not previously - and - what else may been wrong with my PC setup ??

I am well aware there are always reasons for 'funny' things happening, so why this, why now, and why me ???

Hope we can solve this,
Regards,
Phil.
Attachments:

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #7 by Chris Pyrgas
Replied by Chris Pyrgas on topic CRLF - does this still work ?
Hi Phil,

Did you see my previous tip about resetting the "Build\Suppress standard header file" project option to on and off again? This should do the trick, I think the problem is along the lines of what default value is used when that option is not stored in the project file. Setting it on and off should store it in the file and should be ok now.

Karl, in your case you are now getting a parser error because you have also used the DEFINE CRLF that I suggested. You need to use only either one of them, the DEFINE or the one in XSharpDefs.xh, but not both.

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #8 by Karl Faller
Replied by Karl Faller on topic CRLF - does this still work ?
Chris.
ups, sorry, sloppy me ;)
Removed the define, set the "Suppress" to false and voila.
Made a new sample, -> same error. Swapped in "Build" from false to true and back (without intermediate save and/or build) - works now.

Karl

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #9 by Phil Hepburn
Replied by Phil Hepburn on topic CRLF - does this still work ?
Hi Chris,

Yes, this does the trick with my little test sample on Address Book entries.

Presumably this will get fixed for next new build !?

Is it as Karl says and the Template is incomplete ?

Many thanks,
Phil.
Wales, UK.

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #10 by Chris Pyrgas
Replied by Chris Pyrgas on topic CRLF - does this still work ?
Guys,

Thanks for the feedback! Not absolutely sure what the underlying problem is, but I am sure Robert or Fabrice will be able to debug it.

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.