Error when attempting to instantiate an ABC compliant CLASS - Baffled & beaten!

,

I agree, Douglas - and that’s exactly how I’ve handled this situation myself. I had someone else in mind, tho, when I wrote this class/template, who has limited SQL server-side skills.

John

That’s a much more elegant solution, Mark … :+1:

May I push my luck with some clarification questions (?)

  • BOOL is (via EQUATES.CLW) a SHORT data type … Why is that preferable to a BYTE for T/F ?

  • You present 2 methods to return a given field’s “name”; one based on WHO and the other based on Prop:Name. As I understand it, they yield exactly the same result (right?)
    – Why/when would you use one in preference to the other ?

  • I don’t understand the purpose of the .CleanName method; what are the “Extended Name notations as created by Capesoft” ?

Thanks again …

John M

Yeah, the bit twiddling performance oriented part of me doesn’t like the extra byte, and since numeric expressions track back to LONG we don’t really have a win there either.

That said, I like the clarity that BOOL brings to the table.
To me, BOOL says TRUE|FALSE, whereas BYTE says number.

WHO and PROP:Name might return the same thing,
but it’s not the case that they always will return the same thing.

You can declare an external name for a field (or variable)
SomeField STRING(42),NAME(‘DifferentName’)

It’s my understanding that the Clarion SQL file drivers will use the NAME attribute for column names. Which is precisely what you are working on. So I think you should use PROP:Name instead of WHO.

A Proposed Convention for the Extended use of the Name Attribute - code - ClarionHub

If I’m not mistaken Capesoft uses the Extended Name attribute for reflection work to drive xFiles and JFiles behavior. But the idea isn’t limited to just those two cases, it could be used for all sorts of things.

The purpose of the .CleanName method is to provide the class equivalent of an embed point, by calling a ,VIRTUAL method - which can then be derived.

2 Likes

It’s actually SIGNED, which is LONG in Clarion 32 bit.

1 Like

Even worse. :slightly_smiling_face:

I wish we could be complaining that it’s INT64.

Perhaps not worse when passed. Base type for anything less than a LONG is still a LONG.

1 Like

Haha - Yes, I was hoping no-one would notice my mistake :wink:

Aahh - That’s a good point. On that basis, I’m now happy with BOOL.

John