"Chris" <no@spam.com> schrieb:
I chose to post this here because I'm trying to convert a project that
was written back in the day in VB6 and I have a question about syntax
that I've never seen before.
There are multiple forms. One form A, it access something on form B by
using the following syntax:
formB!btnInfo.Caption
What is the purpose of the "!" character? Why isn't the "." character
used instead?
It's just VB6 way to access the instance of formB. VB6 wasn't really OOP.
Not really. '!' was and is used to access keyed collections. Sample:
\\\
Dim c As Collection
Set c = New Collection
Call c.Add("Hello", "Key1")
Call c.Add("World", "Key2")
Call MsgBox(c!Key2)
Call MsgBox(c.Item("Key2"))
Call MsgBox(c("Key2"))
///
The last three lines are semantically equivalent. In the OP's sample the
form's 'Controls' collection is accessed.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>