Just got me the new build, install went smoothly.
Read in What's new:
...
In the Core and VO dialect a literal string that is enclosed with single quotes is a string literal. Double quotes are also string literals...
Starting with template "Basic X#" sample (with Xide 1.09):
FUNCTION Start( ) AS VOID
LOCAL c AS STRING
c:='x'
RETURN
Compiling i get:
Compilation failed (1 error)
error XS0029: Cannot implicitly convert type 'char' to 'string' 3,5 Start.prg Stringdelim
Either i misunderstand the help file or there is something amiss...
On further tries, i find:
LOCAL d AS Char
d:='y'
compiles - without the 'c'prefacing the help says i'd need!?
For completeness is started VS17, tried the same and see the same result.
@Chris: i see this new app listed as "StringDelim(v4.0)-X#", note the missing "/Core" part (properties show language X# and dialect Core) - is this new convention?
HTH
Karl
[2.11] Single vs. double quotes
[2.11] Single vs. double quotes
Last edited by Phil Hepburn on Tue Apr 25, 2017 12:51 pm, edited 1 time in total.
Reason: typo
Reason: typo
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
[2.11] Single vs. double quotes
Hi Karl,
I think you are right, this needs some further clarification. At the moment (in Core dialect), if you specify only one character delimited with single quotes, then this is treated as a Char constant. If there are more than one characters, then it is treated as String. Maybe we will need to review this a bit more again..
As for the "/Core" test not appearing in XIDE, this is a small bug, next time you open the project it will be displayed normally.
Chris
I think you are right, this needs some further clarification. At the moment (in Core dialect), if you specify only one character delimited with single quotes, then this is treated as a Char constant. If there are more than one characters, then it is treated as String. Maybe we will need to review this a bit more again..
As for the "/Core" test not appearing in XIDE, this is a small bug, next time you open the project it will be displayed normally.
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
[2.11] Single vs. double quotes
Yes. Too much "implicit" thinking neededChris Pyrgas wrote:Hi Karl,
I think you are right, this needs some further clarification. At the moment (in Core dialect), if you specify only one character delimited with single quotes, then this is treated as a Char constant. If there are more than one characters, then it is treated as String. Maybe we will need to review this a bit more again..
![Wink ;)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_wink.gif)
BTW, i wonder, why we need the "special" quoting at all? Either the declaration of a var is needed, then there should be no need to "mark" the name in any special kind - or the compiler deduces the type from the assign, then we could drop the declare <g>.
Indeed. No problem...As for the "/Core" test not appearing in XIDE, this is a small bug, next time you open the project it will be displayed normally.
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)