|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Question about a conversion projectGreetings to all!
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? Thanks, Kyjan Kyjan wrote:
Show quoteHide quote > Greetings to all! It's just VB6 way to access the instance of formB. VB6 wasn't really OOP.> > 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? > > Thanks, > > Kyjan > Chris
Show quote
Hide quote
"Chris" <no@spam.com> schrieb: Not really. '!' was and is used to access keyed collections. Sample:>> 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. \\\ 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/> So it was basically used to access the default property (in .NET terms)
of an object? Thank you guys for the reply!
Xcopy Install of VB Classic Application
DataRelation vs DataView.RowFilter property Creating a "Back" button in VB.Net/ASP.Net Project won't run from network drive. How to Use a Screen Saver app within My Application? scope of command and garbage collection Applying word styles using VB .Net using up too much memory and is slow application.exit( ) Comparing Two DataTables SET ARITHABORT ON: Why (not)? |
|||||||||||||||||||||||