System.Diagnostics.Debug.WriteLine(c)

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
User avatar
ArneOrtlinghaus
Posts: 386
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

System.Diagnostics.Debug.WriteLine(c)

Post by ArneOrtlinghaus »

Hello,

I have the line
System.Diagnostics.Debug.WriteLine(c)
in my program together with
#using System.Diagnostics
This compiles under Vulcan.

I get the following error:
XS9002 Parser: unexpected input '.'
I tried substituing the '.' with ':' but I could not find a possibility to geth compiled this code.

Arne
FFF
Posts: 1535
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

System.Diagnostics.Debug.WriteLine(c)

Post by FFF »

Strange, i get:
Compilation failed (1 error)
error XS0234: The type or namespace name 'Debug' does not exist in the namespace 'System.Diagnostics' (are you missing an assembly reference?)
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
Otto
Posts: 174
Joined: Wed Sep 30, 2015 6:22 pm

System.Diagnostics.Debug.WriteLine(c)

Post by Otto »

Hi Arne,

I tried to reproduce your message, but I can't, sorry
Karl, you need a reference to System

Code: Select all

#USING System.Diagnostics

BEGIN NAMESPACE XSharpClassLibrary1
	CLASS Class1
	CONSTRUCTOR()
		RETURN		
        METHOD MyMethod() AS VOID STRICT
           LOCAL c AS STRING
           c := "test"
           System.Diagnostics.Debug.WriteLine(c)
        RETURN
 	END CLASS
END NAMESPACE
Frank Maraite
Posts: 176
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

System.Diagnostics.Debug.WriteLine(c)

Post by Frank Maraite »

Arne, Karl,

Vulcan includes System by default. X# does, as I know, include nothing in the reference list. I had to all those missing references in my old Vulcan code too.

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

System.Diagnostics.Debug.WriteLine(c)

Post by Chris »

Hi Arne & guys,

This looks like a problem with a conjunction of the DEBUG symbol that is automatically defined when compiling in debug mode and the /vo8 compiler option which makes defines non case sensitive. I think we'll need to modify a bit the way the preprocessor works, will log a report about this. In the meantime, please add a @@ (which tells the preprocesor not to touch the word that follows) before Debug, as in:

System.Diagnostics.@@Debug.WriteLine(c)

or

@@Debug.WriteLine(c)

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
ArneOrtlinghaus
Posts: 386
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

System.Diagnostics.Debug.WriteLine(c)

Post by ArneOrtlinghaus »

Thanks,
this works.

Arne
Frank Maraite
Posts: 176
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

System.Diagnostics.Debug.WriteLine(c)

Post by Frank Maraite »

Hey, that's why I like case sensivity.

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

System.Diagnostics.Debug.WriteLine(c)

Post by Chris »

Hi Frank,

> Hey, that's why I like case sensivity.

In general I like it, too, but I hate it that you can define (in c# for example) identifiers with the same name, different case. It is so easy for example to define both a oXml and a oXML local in the same method and then accidentally use one instead of the other..

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Frank Maraite
Posts: 176
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

System.Diagnostics.Debug.WriteLine(c)

Post by Frank Maraite »

Chris,

just tested it. You're right, this is true for C#, but not for Vulcan. In Vulcan case sensivity was only applied to member and type names, not to LOCALs. What a mess.

But: your test's would fail for this case. And in small methods you should see it directly :-).

Frank
User avatar
robert
Posts: 4279
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

System.Diagnostics.Debug.WriteLine(c)

Post by robert »

Arne,

This is fixed in the next build.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply