P
PC
Gentlesofts,
Forgive me. I'm an abject newbie in your world, using VB 2005 with the
dot-Net wonderfulness.
So, I'm writing a wonderful class or two to interface with a solemnly
ancient database. In times recently past, I would have done this with
Borland Delphi. So, that's my perspective and I have my old Delphi
code to crib from. That seems good.
So, to make sense of the ancient database, we need a wonderful set of
CONSTANTs. Programs using the VB classes will need to have some
knowledge of the CONSTANTs -- i.e. they need to be publically visible.
That seems (arguably) good.
So, I have understood that NAMESPACEs are a wonderful new thing and I
see their value and I'm writing my ancient database classes and
utilities in a new NAMESPACE named, sentimentally, after the long lost
DBMS. That seems good.
So, I define the CONSTANTs with code like this...
Const DES_REC_OUTPUT_PAT As Integer = 14
These CONSTANTs are within the NAMESPACE, but outside of any CLASS
definition. That seems like it should be good, but VS brands the code
with a pestilent wavy line and announces...
"Statement is not valid in a namespace"
So, I ask you gently, "WTH?"
The wonderful HELP Oracle tells me that I can define many things within
a NAMESPACE, including classes, structures and (notably) ENUMERATIONs.
But NOT CONSTANTs.
So again, I'm new to your culture. But, I don't understand why a
NAMESPACE can include ENUMERATIONs but NOT CONSTANTs. These things are
semantic sisters and I just don't get the distinction. To my way of
thinking, this appears to be a flat-out defect in the language. Feel
free to set me straight.
So most importantly, could someone offer a wonderful way to implement
the functionality -- something more consistent with the philosophies of
this VB dot-Net culture? My current thinking is that I might implement
a static class to contain the constants. Does that seem good?
TIA and Love, PC
Forgive me. I'm an abject newbie in your world, using VB 2005 with the
dot-Net wonderfulness.
So, I'm writing a wonderful class or two to interface with a solemnly
ancient database. In times recently past, I would have done this with
Borland Delphi. So, that's my perspective and I have my old Delphi
code to crib from. That seems good.
So, to make sense of the ancient database, we need a wonderful set of
CONSTANTs. Programs using the VB classes will need to have some
knowledge of the CONSTANTs -- i.e. they need to be publically visible.
That seems (arguably) good.
So, I have understood that NAMESPACEs are a wonderful new thing and I
see their value and I'm writing my ancient database classes and
utilities in a new NAMESPACE named, sentimentally, after the long lost
DBMS. That seems good.
So, I define the CONSTANTs with code like this...
Const DES_REC_OUTPUT_PAT As Integer = 14
These CONSTANTs are within the NAMESPACE, but outside of any CLASS
definition. That seems like it should be good, but VS brands the code
with a pestilent wavy line and announces...
"Statement is not valid in a namespace"
So, I ask you gently, "WTH?"
The wonderful HELP Oracle tells me that I can define many things within
a NAMESPACE, including classes, structures and (notably) ENUMERATIONs.
But NOT CONSTANTs.
So again, I'm new to your culture. But, I don't understand why a
NAMESPACE can include ENUMERATIONs but NOT CONSTANTs. These things are
semantic sisters and I just don't get the distinction. To my way of
thinking, this appears to be a flat-out defect in the language. Feel
free to set me straight.
So most importantly, could someone offer a wonderful way to implement
the functionality -- something more consistent with the philosophies of
this VB dot-Net culture? My current thinking is that I might implement
a static class to contain the constants. Does that seem good?
TIA and Love, PC