473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Question about a conversion project

Greetings 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

May 24 '06 #1
3 799
Kyjan wrote:
Greetings 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

It's just VB6 way to access the instance of formB. VB6 wasn't really OOP.

Chris
May 24 '06 #2
"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/>

May 24 '06 #3
So it was basically used to access the default property (in .NET terms)
of an object?

Thank you guys for the reply!

May 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: David W. Fenton | last post by:
A client is panicking about their large Access application, which has been running smoothly with 100s of thousands of records for quite some time. They have a big project in the next year that will...
1
by: Michael Tissington | last post by:
I'm trying to convert a project from VS2003 to VS2005 After conversion all of my TagPrefix are not recognized in the body. <%@ Register TagPrefix="Oaklodge" TagName="Curve"...
1
by: musosdev | last post by:
Hi I've got a project I've just run through the conversion wizard, and it's giving me a few headaches. I've got a user control which has controls referrenced from its calling page...
31
by: Martin Jørgensen | last post by:
Hi, I've had a introductory C++ course in the spring and haven't programmed in C++ for a couple of months now (but I have been programmed in C since january). So I decided to do my conversion...
4
by: Coleen | last post by:
Hi All :-) I'm new to this site. I've been trying to convert several .Net 2003 web applications and getting tons of conversion errors. I found this site to help walk me through the...
0
by: =?Utf-8?B?RWFjaHVz?= | last post by:
I've made several attempts to upgrade an application from asp.net 1.1 to 2.0. I open the web site by selecting the vbproj file, by selecting the solution file, or by selecting the web application....
10
by: Jeroen | last post by:
Hi guys, Just another question. Suppose I have 2 classes (incomplete code): class A { A(const B& b); A& operator = (const A& a); }; class B {
4
by: Bit Byte | last post by:
I am working on a large project and have several modules written compiled using MBCS. I am considering purchasing a third party library which I understand, is compiled to support unicode strings. ...
7
by: Tony Johansson | last post by:
Hello! Why does not this cause a compile error because a ulong has never been implicitly convertible to byte? ulong vektor = {100000,200000,300000}; foreach(byte b in vektor) {...
13
by: =?Utf-8?B?RGF2ZSBXZWVkZW4=?= | last post by:
Hi all, I'm having trouble with a project that I've distilled down to the following code. Unfortunately it won't compile and gives the following error (caused by the call to GetHorses() in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.