 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
WillR Guest
|
Posted: Wed Apr 04, 2007 9:52 pm Post subject: Int64 |
|
|
I am using Interbase 7.5.(latest avail). I have just installed IB
Express version 7.11 with IB2007 support.
The property, ".asInt64" only appears for "parambyname" -- not "fieldbyname"
I only see ".asInteger" -- It does not seem to include Int64 -- only 32
bit integers.
So you must go through typecasts or use ".value" -- I presume a much
slower operation.
I think that if the Delphi designers/coders intended the use of Int64 in
Delphi 7 with IBX then it is a genuine bug.
This compiles...
ibdsSitePhoto.FieldByName('SAMP_SITECHAR_ID').Value :=
dbSiteChar2.fieldbyname('SAMP_SITECHAR_ID').asInteger;
and this...
ibdsSitePhoto.FieldByName('SAMP_SITECHAR_ID').Value :=
dbSiteChar2.fieldbyname('SAMP_SITECHAR_ID').Value;
This doesn't...
ibdsSitePhoto.FieldByName('SAMP_SITECHAR_ID').Value :=
dbSiteChar2.fieldbyname('SAMP_SITECHAR_ID').asInteger;
nor does this...
ibdsSitePhoto.FieldByName('SAMP_SITECHAR_ID').Value :=
dbSiteChar2.fieldbyname('SAMP_SITECHAR_ID').aslargeint;
ibdsSitePhoto.FieldByName('SAMP_SITECHAR_ID').Value :=
dbSiteChar2.fieldbyname('SAMP_SITECHAR_ID').asInt64;
Is this viewed as a problem that will be fixed?
--
Will R
PMC Consulting |
|
| Back to top |
|
 |
Craig Stuntz [TeamB] Guest
|
Posted: Thu Apr 05, 2007 1:28 am Post subject: Re: Int64 |
|
|
As I noted in the other group you posted this to, you're simply wrong
on this.
AsInt64 is a property of the IBX Param object, which is not part of
the (non-IB-specific) VCL. It was needed because back when IBX was
created and for many years thereafter the VCL's TParams couldn't handle
Int64s. That bug has been fixed long ago in the VCL. The fact that IBX
has to use a custom Param class is at this point historical, but it's
the way that it is.
OTOH, the VCL does support and always has supported Int64 *fields*.
There is no need at all for IBX to do anything special for this. You
can use the AsLargeInt property for that.
The behavior you're describing has *nothing to do with IBX.* You're
asking that the VCL work differently than it does. You seem to be
expecting one of the following to be true:
1) TField should have properties for every possible data type that any
conceivable subclass might ever want to expose, including things like
AsLargeInt, AsDate, AsBlob, which are not there now.
2) TDataSet.FieldByName should return a strongly-typed reverence to,
e.g., TLargeIntField instead of an abstract TField reference.
(1) is IMHO a bad design and (2) is impossible in Delphi.
--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Please read and follow Borland's rules for the user of their
server: http://support.borland.com/entry.jspa?externalID=293 |
|
| Back to top |
|
 |
WillR Guest
|
Posted: Thu Apr 05, 2007 1:47 am Post subject: Re: Int64 |
|
|
Craig Stuntz [TeamB] wrote:
| Quote: | As I noted in the other group you posted this to, you're simply wrong
on this.
|
Craig:
I am hoping that I am not "wrong" on this -- simply posing the question
"Is this worthwhile?" albeit implied.
| Quote: |
AsInt64 is a property of the IBX Param object, which is not part of
the (non-IB-specific) VCL. It was needed because back when IBX was
created and for many years thereafter the VCL's TParams couldn't handle
Int64s. That bug has been fixed long ago in the VCL. The fact that IBX
has to use a custom Param class is at this point historical, but it's
the way that it is.
|
| Quote: | OTOH, the VCL does support and always has supported Int64 *fields*.
There is no need at all for IBX to do anything special for this. You
can use the AsLargeInt property for that.
The behavior you're describing has *nothing to do with IBX.* You're
asking that the VCL work differently than it does. You seem to be
expecting one of the following to be true:
|
Yes. Right or wrong.
| Quote: | 1) TField should have properties for every possible data type that any
conceivable subclass might ever want to expose, including things like
AsLargeInt, AsDate, AsBlob, which are not there now.
|
Again -- why not? Bad idea? Good idea? Impossible? Unnecessary?
In mu opinion a good idea -- as the list is not infinite -- quite
limited in fact...
| Quote: | 2) TDataSet.FieldByName should return a strongly-typed reverence to,
e.g., TLargeIntField instead of an abstract TField reference.
|
| Quote: | (1) is IMHO a bad design and (2) is impossible in Delphi.
|
And there we are...
If that is so -- then what's the point of any further discussion -- and
I will leave it there.
--
Will R
PMC Consulting |
|
| Back to top |
|
 |
WillR Guest
|
Posted: Thu Apr 05, 2007 2:32 am Post subject: Re: Int64 |
|
|
Craig Stuntz [TeamB] wrote:
| Quote: | WillR wrote:
I am hoping that I am not "wrong" on this -- simply posing the
question "Is this worthwhile?" albeit implied.
Repeat: This has nothing to do with IBX. You keep asking about IBX,
and now you've posted it to the IBX group, but this is not an IBX
issue. Changing IBX won't "fix" it.
Again -- why not? Bad idea? Good idea? Impossible? Unnecessary?
It's not impossible to do (1). I don't think it's a great design,
because it makes TField unnecessarily fat, and because most field types
will never implement it, but the current design is arguably not great
anyway.
|
Funny thing that -- I've said that sort of stuff about my own code
occasionally. :-)
| Quote: | But again, it's pretty much off-topic here. What you're asking for is
a feature request for the DB VCL, not IBX. You can QC it if you want
and see if other people like it. Just don't bring up IBX params again
because that only confuses the issue; it's a completely separate
subject with its own history which would not be implemented the way it
is if it was created today.
|
It's clear that I did not understand the separation of issues -- or
rather did not note where I was as I traced the code -- and yes I was in
the db VCL when I spotted most of the points of interest.
Having written code that typed data and set field properties when a a db
was opened (ACCPAC accounting interface) -- I did not think it was that
bad at first to make such a change -- clearly I do not have intimate
knowledge of the appropriate layers.
And as you noted above by implication... Hindsight and experience are
wonderful things.
I will stick to typecasting where necessary as you have pointed out that
I can do when necessary. One more thing to remember...
--
Will R
PMC Consulting |
|
| Back to top |
|
 |
Craig Stuntz [TeamB] Guest
|
Posted: Thu Apr 05, 2007 3:02 am Post subject: Re: Int64 |
|
|
WillR wrote:
| Quote: | I am hoping that I am not "wrong" on this -- simply posing the
question "Is this worthwhile?" albeit implied.
|
Repeat: This has nothing to do with IBX. You keep asking about IBX,
and now you've posted it to the IBX group, but this is not an IBX
issue. Changing IBX won't "fix" it.
| Quote: | Again -- why not? Bad idea? Good idea? Impossible? Unnecessary?
|
It's not impossible to do (1). I don't think it's a great design,
because it makes TField unnecessarily fat, and because most field types
will never implement it, but the current design is arguably not great
anyway.
But again, it's pretty much off-topic here. What you're asking for is
a feature request for the DB VCL, not IBX. You can QC it if you want
and see if other people like it. Just don't bring up IBX params again
because that only confuses the issue; it's a completely separate
subject with its own history which would not be implemented the way it
is if it was created today.
--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Useful articles about InterBase development:
http://blogs.teamb.com/craigstuntz/category/21.aspx |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Thu Apr 05, 2007 8:00 am Post subject: Re: Int64 |
|
|
WillR wrote:
| Quote: | Again -- why not? Bad idea? Good idea? Impossible? Unnecessary?
|
It violates the concept of object oriented design. It would create a
TField class that would have properties that would generate an error
most of the time that the property was accessed. Consider the case of
using the AsLargeInt property of this new TField class. What do you
think should happen when the underlying data type is DateTime or
Boolean? To me this seems a bad idea.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|