Re: Conversion Problem
- From: "Armin Zingler" <az.nospam@xxxxxxxxxx>
- Date: Mon, 14 Jul 2008 20:20:00 +0200
"Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb
"Armin Zingler" <az.nospam@xxxxxxxxxx> wrote in message
news:eNfhqu64IHA.2060@xxxxxxxxxxxxxxxxxxxxxxx
> "Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb
> > re-wrote VB basically from the ground up
>
> Luckily they did. Finally got rid of all the hacks.
>
>
>
> ...talking about control arrays:
>
> Why does a CommandButton have an Index (property) even if it does
> not belong
> to a "control array"?
Hopefully, you're not expecting an object to add/remove properties,
just because it may or may not be part of an array.
The object should not care whether or not it belongs to an array. Therefore
it must not have an Index property. If it does have an Index property it
always would have to belong to an array - which is not true either.
> Or, create a control array of CommandButtons. Name it "Command1".
> Write "MsgBox Command1.UBound". Put the caret on the word
> "Command1" and press Ctrl+I. The IDE says: "Command1 As
> CommandButton". Huh?? The type of the array is CommandButton, too?
> I thought that's the type name of a single button. Where is that
> type declared? I don't find it in the object browser.
> I not even find "Ubound" anywhere in the object browser. Maybe I
> should buy
> new glasses.
You may be right about "time for new glasses". In *my* object
browser, it clearly states:
Class CommandButton
Member of VB
This class does not have a UBound property. So again, where is the class
declared? If you find the property (and LBound, Count etc), send me a
screenshot.
> Or, try this in the immediate window:
>
> ? typename(command1(index))
> CommandButton
> ?typename(command1)
> Object
>
> "Object"? Well...and what is the type of the object? It's probably
> "VB-special-type-under-the-hood-and-nobody-will-ever-know"?
"Object" didn't make that much sense... with that, I agree... but,
since *everything* is supposedly an "Object" in dotNet,
Try it in VB6, not in dotnet.
why does it surprise you?
It does not surprise me because I already know that not even VB6 is
able to tell me the class name of a control array.
What *really* suprises me is the fact they simply
renamed "Variant" to "Object" for dotNet.
That's because there is a CLS and a common type system now. I think the C#
people wouldn't understand why the VB people would have their
once-again-VB-special data type that is not even available in the Framework.
What's the purpose of 'Variant' if there is already 'Object'? I wouldn't
have an answer if I was asked this.
> Or, look at this, inside the Form:
>
> Sub X(o As ???)
> Msgbox o.
> End Sub
umm... you're saying you have an IDE that excepts question marks as
a Type? Better re-install.
Wrong. I wrote: "By what do the ??? have to be replaced..." (whole question
below again). Can you answer it?
> Sub Y()
> MsgBox Command1.UBound 'supported by intellisense
> X Command1 'Remember: it's an array!
> End Sub
>
> By what do the ??? have to be replaced in order to get the
> intellisense list
> (ubound, lbound, item, count) when typing "o." inside Sub X?
> What's the type? Can you tell me?
Exactly what information are you looking for here?
I'm looking for the class name or type name of a control array that seems to
be defined nowhere. Because it's a hack.
Intellisense
doesn't work when there are errors or missing libraries. Is that a
surprise?
No. The problem is that there is no way to make it compilable because you
won't find the type anywhere.
> BTW, I don't need control arrays too because the main intentions a
> programmer has can be achieved by means that did not even exist in
> VB6. They
> are:
> - Create controls dynamically. "New CommandButton" does not work
> in VB6.
Pulllleeeezzzzz. Gimme a freaking break. You can create all the
controls you need, array or not, at runtime. The fact *you* don't
know how isn't a fault of the language.
I do know how, but you obviously don't see that there is a difference made
between "normal" classes and controls. Because it's a hack.
> "New Button" works well in VB today.
> - Attach/remove handlers dynamically. No more being forced to have
> a template control at design time because Add/Removehandler did
> not even exist. Now being able to attach any handler of any event
> as long as signatures match. (and, you can name the handler
> whatever you want)
Not impressed.
If you're not impressed by facts, a discussion rarely makes sense. Of
course, you can ingore them and do more work and be less flexible.
Since it was built from the ground up, why did they literally steal
the name? It's not VB. You said so yourself. It's "something else",
but it's not VB.
Is - is not - is - is not.... Only seeing black and white? What I always
say: The degree of similarity can not be measured. Some things have changed,
some things have not. How many percents? I don't know, and I don't care
which name is written on the package. You may be right, but what's in the
package is the only thing that counts. Making use of it's content, I can
still write "If..then", "function..end function", "sub...end sub", "do
loop", "select case". If I am not completeley mistaken that's taken from VB6
and not from C++, so, yeah, it's still Visual Basic. These are basic
language keywords. Even "End" still works....
> My Amstrad CPC464 back in 198? "booted" within one second. Was it
> better?
I can see you're settling in and just accepting slow boot times.
Good for you. imo, it shouldn't take a quad-core CPU with 4 gigs of
ram to boot in less time than it takes to mow your lawn... But, if
that's what you like, have at it.
That's partially true. Actually I agree with you, so it's bringing sand to
the beach. It shouldn't take a quad-core etc, but I accept that it requires
more than a 64 KB machine to be able to do what I do nowadays.
Well,,, my main statement is: It saves me much more time by being able to
write "Inherits List(Of Whatever)" than it costs me by not having control
arrays any longer. And I feel better if I am able to use "New" with controls
just like with every other class because I don't see why I should be forced
to make a distinction like in VB6. An example only.
Armin
.
- References:
- Conversion Problem
- From: John
- Re: Conversion Problem
- From: Patrice
- Re: Conversion Problem
- From: John
- Re: Conversion Problem
- From: Ken Halter
- Re: Conversion Problem
- From: Armin Zingler
- Re: Conversion Problem
- From: Ken Halter
- Conversion Problem
- Prev by Date: Re: working with SQL null values....
- Next by Date: Re: Conversion Problem
- Previous by thread: Re: Conversion Problem
- Next by thread: Re: Conversion Problem
- Index(es):
Relevant Pages
|