Mark,

The reason Patrick tripped up on that is implicit type-casting. In VB6,
he would have got away with it. Not so in VB.Not.

So it's probably the fault that he has done so much in VB6 - if he were
new to this, he might well not have made the same mistake as he would be
learning not to rely on implicit type-casting as we have done for so
many years in VB.

Also, beginners in VB.Not have more to worry about than this - this is
not really a language specific fault, but a CLR "fault" - once you know
more about the CLR you don't make this mistake. Beginners have far more
to worry about in learning the framework and the available classes than
small issues like this that they will encounter once and never make that
mistake again...

Cheers,
Dino

BTW - ex VB6 user myself, switched to C# - prefer the cleaner language
which doesn't have a "Format" function - instead you have to use the
.ToString() of each object which is much safer.

-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of
Mark Burns
Sent: Tuesday, 28 May 2002 14:37
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] VB.NET Oddity


Patrick,

Uhm...You are one of the more expert/experianced VB developers out
there, right?

...and even you would "never have thought of that" in regards to
something seemingly simple and relatively inocuous in this new
VB.Net?...

Tell me, does this tell you _anything at all_ about this new "Visual
Basic"? (remember that the first word in Basic is supposed to be
"Beginners'"?) How in the heck is a real, actual BEGINNER supposed to
cope with nuances like these if someone like you gets hung up by these
sorts of "little things"?

...Just curious if you had any thoughts on this subject at this point
given your experience using VB.Net...

- Mark Burns
<former .NOTer - said for honesty's sake, not as a procliamation of
anything - I've backed off and attempted to remain neutral in the
.Net/.Not religious wars in recent months>

----- Original Message -----
From: "Patrick Burrows" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 26, 2002 10:02 PM
Subject: Re: VB.NET Oddity


> ---------------------- Information from the mail
header -----------------------
> Sender:       dotnet discussion <[EMAIL PROTECTED]>
> Poster:       Patrick Burrows <[EMAIL PROTECTED]>
> Subject:      Re: VB.NET Oddity
> ----------------------------------------------------------------------
> ----
-----
>
> Thanks, Mike, that worked.
>
> FWIW, I would never have thought of that. While I'm formatting them as

> dates, at all time they are used and displayed as strings.
>
> Anyway, thanks.
>
>
> On Mon, 27 May 2002 11:57:31 +1000, Michael Weinhardt
> <[EMAIL PROTECTED]> wrote:
>
> >Hi Patrick,
> >
> >I think the Format function considers "1:00" to be a string and
> subsequently can't match with the formatting defined by "hh:mm tt"
> >
> >try this:
> >
> >Format(CDate("1:00"), "hh:mm tt")
> >
> >cheers,
> >mw
> >
> >> -----Original Message-----
> >> From: Patrick Burrows [mailto:[EMAIL PROTECTED]]
> >> Sent: Monday, 27 May 2002 11:53 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: [DOTNET] VB.NET Oddity
> >>
> >>
> >> Can anyone explain to me these results in VB.NET:
> >>
> >> ?Format("1:00", "hh:mm tt")
> >> "hh:mm tt"
> >>
> >> I am expecting it to be "1:00 am"
> >>
> >> I can get named formats to work ("Medium Time") but not any custom
> >> formats.
> >>
> >> What am I missing?

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.363 / Virus Database: 201 - Release Date: 21/05/2002


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.363 / Virus Database: 201 - Release Date: 21/05/2002

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to