> Bearing in mind that Type objects look the same regardless of
> what language you are using, why would you expect it to give
> you a VB-specific name? How's it supposed to know what
> language you're calling from.
It shouldn't know that up front. However it does come up with a
string that works in C# but doesn't in VB.NET :) It's just about
primitives that are converted from db types to .net types, so the only
array I have is the System.Byte[] for blobs/binary data anyway. Because
the types were set in a piece of code that is written in C# I thought
maybe it was related to that, but in a VB.NET app, I too get
System.Byte[], so the language it is written in is not setting anything
special, as you described. So it just coughs up a CLR type and for this
single one I can't use that one :D Ah well...
[...]
> As for the problem you're trying to solve, why don't you use
> the CodeDOM to generate your code? That abstracts away
> details like this, and allows the CodeDOM implementation
> you're using to decide on the right way to describe a
> particular type in your language of choice.
I don't know if you've tried to generate code with codedom (and
I mean a large pile of code) but you're typing your @ss off :) Plus, I
use templates which are processed by an interpreter, CodeDom would be
very cumbersome to use in this case; the templates together are 330KB of
code. Putting all that in CodeDom statements is not doable, sorry.
> Any realistic solution to this problem that Microsoft could
> have provided is going to have to look something like this
> anyway - the set of languages is unbounded in .NET: anyone
> can write their own programming language! So they can't
> simply define an enum of all the languages and provide a
> property of the Type object that uses that to let you choose
> what flavour you'd like your type expressions in. You might
> be using a language that the team that wrote the Type object
> haven't even heard of.
I understand. I'll configure my code emitter so it can work with
a setting for array types which is set in the template set config file.
It's just 1 type, Byte[] :), the rest is in code in the templates
already.
> To solve this problem in a general way, there will always
> need to be some body of code supplied by the language vendor
> (or at least specific to that language). Admittedly the
> CodeDOM is a rather heavyweight solution to the specific
> problem you're focusing on, but it actually solves a whole
> raft of code-gen problems. (And since the problem you
> describe is one you're most likely to come across in a code
> gen scenario, it's not unreasonable that the facility for
> doing this is a part of the CodeDOM.)
CodeDOM is not a solution I can use, sorry. But thanks for the
reply :)
FB
>
>
> --
> Ian Griffiths
> DevelopMentor
>
> > -----Original Message-----
> > From: Frans Bouma [mailto:[EMAIL PROTECTED]
> >
> > Ok, I'm now struggling with some VB.NET related stuff. If I
> do this:
> > Dim arr() As System.Byte = New System.Byte(10) {}
> > Console.WriteLine("type = " & arr.GetType().ToString())
> >
> > I'd expect to see:
> > type = System.Byte()
> >
> > however I see:
> > type = System.Byte[]
> >
> > I understand that the type's ToString() has to report
> something, but
> > isn't there a setting I can set so it will return VB.NET syntaxis?
> (And
> > I don't have to alter my code emitter? :D)
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
> NEW! ASP.NET courses you may be interested in:
>
> 2 Days of ASP.NET, 29 Sept 2003, in Redmond
> http://www.develop.com/courses/2daspdotnet
>
> Guerrilla
> ASP.NET, 13 Oct 2003, in Boston
> http://www.develop.com/courses/gaspdotnet
>
> View archives and
> manage your subscription(s) at http://discuss.develop.com
>
>
>
===================================
This list is hosted by DevelopMentor� http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet
Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet
View archives and manage your subscription(s) at http://discuss.develop.com