xsharp.eu • XS9016 Class name .. differs : just by adding optional class statement
Page 1 of 1

XS9016 Class name .. differs : just by adding optional class statement

Posted: Thu Aug 18, 2022 8:27 pm
by ic2
Consider this:

Code: Select all

Public Partial Class NewEmail
Method AcceptSaveAndSendEmail() As Logic Pascal Class NewEmail
Return Self:AcceptAndSaveAndOrSendEmail(True, False, True, Null_date) 

Method AcceptAndSaveAndOrSendEmail(lSend As Logic, lAuto As Logic, lCheckAddress As Logic, dSendDate As Date) As Logic Pascal Class NewMail
ENDCLASS //Newmail
As you can see I add Class (something) like in VO as this makes it directly visible in which class you are working which in VS requires you to look to the upper left of the screen while it doesn't show when you are browsing.

So the CLASS xx is optional, like a comment.

Why then do I get this error in the 2nd method then? The first method is fine, with the 2nd method just below (so in the same class) the 1st, only this error shows (until I remove class NewMail again which I don't want)

Error XS9016 Class name NewMail for method differs from parent class name NewEmail

Dick

XS9016 Class name .. differs : just by adding optional class statement

Posted: Thu Aug 18, 2022 9:40 pm
by Chris
Hi Dick,

The class name (and class clause in the first method) is "NewEmail", while the class clause in the second method is "NewMail"

XS9016 Class name .. differs : just by adding optional class statement

Posted: Thu Aug 18, 2022 11:02 pm
by ic2
Hello Chris,

Yes! How could I miss that.
It makes me wonder one thing. I thought adding Class XX after a method was merely info. Like I could write anything, a comment.

But the compiler is actually doing something with it I now understand?

Dick

XS9016 Class name .. differs : just by adding optional class statement

Posted: Fri Aug 19, 2022 4:37 am
by Chris
Hi Dick,

Yes, of course, the X# compiler does make a lot of checks to see if what you type is valid. It's not like in VO, where you can accidentally write a lot of incorrect things or typos and the compiler does not even warn you ;)