Thanks for your replies. I suspected there was no such thing, it's
just kind of surprising. I realize that the VB way is to concatenate
the individual components of the defined type to arrive at one large
string, but that kind of cripples its functionality.
There are a number of non-object traditional languages that support
redefinition, I've worked primarily with COBOL, Powerhouse and VAX
BAsic, so I suspect it's a limitation of VBA, rather than being an OE
vs non-OE thing.
Another data structure that seems to be "missing" in Access from my
perspective is the ability to sub-define items in table design. Both
COBOL and Powerhouse let you define a table item like this for example
TRANS-DATE ZONED UNSIGNED 8
_TRANS-DATE-ASCII CHARACTER 8
.TRANS-DATE-YEAR CHARACTER 4
.TRANS-DATE-MONTH CHARACTER 2
.TRANS-DATE-DAY CHARACTER 2
Zoned decimal is essentially ASCII, so a date defined as zoned
(TRANS-DATE) can be redefined as ASCII (TRANS-DATE-ASCII), which can be
broken into sub-items, indicated by the dot notation in Powerhouse.
COBOL is similar, and I seem to remember doing this is C as well. We
would typically define a date like this in Powerhouse to be able to
assign a numeric value, e.g. the system date, to TRANS-DATE, and be
able to reference it or it's components as ASCII. Alternately, computed
values, e.g., a date in an ensuing month or fiscal year, could be
assigned to the year, month, and day sub-items and referenced as a
numeric via TRANS-DATE, or as an entire ASCII date via
TRANS-DATE-ASCII.
Oh well, enough reminiscing about the past, back to the task at
hand....
Thanks again.
Rich P wrote:
The simplest thing you could do is to write a function (which I suspect
is what your redifinition thing is) to concatenate the elements of your
data structure:
bh.Rectype = "A"
bh.ServiceClassCd = "BBB"
bh.CompanyName ="CCCCCCCCCCCCCCCC"
Function concatElements(bh As BatchHeader1) As String
concatElements = bh.RectType & bh.ServiceClassCD & bh.CompanyName
End Function
strBig = concatElements(bh)
If you want to do something like
Dim strBig As String = bh
then you need to use an Object oriented version of VB like VB.Net. VBA
is not object oriented - does not support polymorphism, overloading, or
inheritance
HTH
Rich
*** Sent via Developersdex http://www.developersdex.com ***