xsharp.eu • CRLF - does this still work ?
Page 1 of 1

CRLF - does this still work ?

Posted: Sun Oct 22, 2017 6:36 pm
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.

CRLF - does this still work ?

Posted: Sun Oct 22, 2017 9:42 pm
by Chris
Hi Phil,

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

CRLF is defined in the IncludeXSharpDefs.xh file, as:

#define CRLF e"rn"

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

DEFINE CRLF := e"rn"

Chris

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 6:14 am
by FFF
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"rn" solved it - seems, the xh file is not included with this template..

HAND
Karl

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 8:04 am
by Chris
Guys,

Hmm, I think you're right, there seems to be a problem there. Please open the project properties in VS, set the "BuildSuppress 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

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 8:30 am
by FFF
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"rn"'
Back to "True" -> works again...

HTH
Karl @VS17 15.0.0 (great, "about" dialog doesn't let you copy version info....)

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 10:04 am
by Phil Hepburn
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 :-
CRLFissues_02.jpg
CRLFissues_02.jpg (38.46 KiB) Viewed 373 times
When I made my own class variable it worked as below, which is not a surprise :S
CRLFissues_01.jpg
CRLFissues_01.jpg (69.87 KiB) Viewed 373 times
CRLFissues_03.jpg
CRLFissues_03.jpg (79.56 KiB) Viewed 373 times
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.

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 11:00 am
by Chris
Hi Phil,

Did you see my previous tip about resetting the "BuildSuppress 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

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 11:05 am
by FFF
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

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 12:44 pm
by Phil Hepburn
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.

CRLF - does this still work ?

Posted: Mon Oct 23, 2017 2:21 pm
by Chris
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