fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: CRLF - does this still work ?

CRLF - does this still work ? 1 year 7 months ago #2950

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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.

CRLF - does this still work ? 1 year 7 months ago #2951

  Chris's Avatar Chris Offline Posts: 1137
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.

CRLF - does this still work ? 1 year 7 months ago #2953

  FFF's Avatar FFF Offline Posts: 565
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.

CRLF - does this still work ? 1 year 7 months ago #2954

  Chris's Avatar Chris Offline Posts: 1137
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.

CRLF - does this still work ? 1 year 7 months ago #2955

  FFF's Avatar FFF Offline Posts: 565
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....)

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

Last edit: by FFF. Reason: typo

CRLF - does this still work ? 1 year 7 months ago #2956

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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.

CRLF - does this still work ? 1 year 7 months ago #2958

  Chris's Avatar Chris Offline Posts: 1137
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.

CRLF - does this still work ? 1 year 7 months ago #2959

  FFF's Avatar FFF Offline Posts: 565
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.

CRLF - does this still work ? 1 year 7 months ago #2965

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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.

CRLF - does this still work ? 1 year 7 months ago #2967

  Chris's Avatar Chris Offline Posts: 1137
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.

  • Page:
  • 1