The Format$() function in VB6 accepted strings as arguments and returned
strings as a result. Yes, it could also return dates, or numbers, or
whatever else. And it could also accept all those values. 

Frankly, it never occurred to me that in VB6 the value I passed in would
be first coerced into the native value of the format I wanted. In fact,
I can't think of a logical reason why the guy who wrote the Format()
function would do this. In fact, I would think it would be best to
convert anything passed in, no matter what, into a string, do the
formatting (which is now easier cause it is a string) and then return
the result.

Remember, I have a string that I am using as a string and displaying as
a string. Sure, in english, it happens to read as a date, but that
should not matter to the program. Nowhere in code do I want to treat
this value as if it were a date. I do, however, want to format it
according to certain rules. And yes, those rules are the rules for a
date. But everything I pass in to the function, and everything the
function accepts, is a string.

Frankly, not only did I not think I would need to coerce the type, I
still don't think it should be necessary. At least not with Option
Strict off.

I wonder what would happen if I tried:
  format(100,"MM/DD/YYYY")
in VB.NET. (I don't have it here to try).

I would expect with Option Strict off I would get:
  04/09/1900
and with Option Strict on I would get:
  "MM/DD/YYYY"

But I am suspecting I will get "MM/DD/YYYY" with both.

It doesn't matter, and this is certainly a molehill, not a mountain.
It's just one of those little idiosyncratic things that are different
between the two languages. Sort of drives home the point that this is
not Visual Basic. 



Patrick Burrows
What's he building in there?
--------------------
Now Playing: mighty mighty bosstones - track 12 -
--------------------



> -----Original Message-----
> From: Steve Johnson [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, May 27, 2002 10:47 PM
> To: [EMAIL PROTECTED]
> Subject: Re: VB.NET Oddity
> 
> 
> > ...and even you would "never have thought of that" in regards to
> > something
> > seemingly simple and relatively inocuous in this new VB.Net?...
> 
> 
> Uhhh...
> 
> 1 - What's new about this?
> 
> 2 - What the heck does this have to do with VB vs. other languages?  I
> can't think of a date class or API that reads the mind of the
> developer.
> 
> 3 - What does this have to do with beginner vs. more experienced
> developers?
> 
> 
> Is any API or language supposed to read the mind of the developer in
> order to properly render an only partially-provided date string?  Do
> not beginners and experienced developers alike need to consult the
> docs in order to use the API/Class Library correctly?
> 
> What's your point, if any?  If you're only here to bash a programming
> technology, why don't you take your bandwidth-hogging spam elsewhere.
> I already have to comb through 160+ messages per day here.
> 
> Thanks,
> 
> 
> --
> Steve Johnson
> 3t Systems
> 
> You can read messages from the DOTNET archive, unsubscribe 
> from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
> 

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