Re: [ADVANCED-DOTNET] Setting a Constant Value in VB.Net

2008-08-06 Thread Stuart Dunkeld
>Const c1FullAddr as String = "1 Colonial Drive Parma Ohio 21321" > > Then they follow that up with another constant: > >Const c1FaLen as String = c2FullAddr.length > > In VB.Net you cannot do this. Is there a way to do this without having to > count the length of c1FullAddr an

Re: [ADVANCED-DOTNET] Setting a Constant Value in VB.Net

2008-08-06 Thread Peter Ritchie
As you've guessed, there's no compile-time ability to get the length of a string (or to execute any member of any const at compile-time). ReadOnly members are the way to get around this problem. For example: Public Shared ReadOnly c1FullAddr As String = "1 Colonial Drive Parma Ohio 21321"

Re: [ADVANCED-DOTNET] Setting a Constant Value in VB.Net

2008-08-06 Thread John Warner
Go with the string, what the old code is doing is reserving an array and then populating it later. VB and most modern languages I'm aware of won't allow you to do this with a constant. Save the headaches of work arounds and go with your gut, convert to DIM. John Warner > -Original Message---

[ADVANCED-DOTNET] Setting a Constant Value in VB.Net

2008-08-06 Thread Greg Rothlander
I'm moving some code from an old language and rewriting it in .Net. I have come across an odd situation where I will have to go in and rework a great deal of code and I'm looking for a less complex and time consuming solution. Here's the basic idea... In the old language they are using a string c