473,659 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pointer Comparision

I know this should be simple but I can't find it.

Dim A as new object
Dim B as object
B = A

Do Bunch of stuff

Check if B still = A

This is basically pointer comparision in C++ days. how do I check that
A and B still point to the same object?

Chris
Nov 21 '05 #1
2 1022
I Don't Like Spam wrote:
I know this should be simple but I can't find it.

Dim A as new object
Dim B as object
B = A

Do Bunch of stuff

Check if B still = A

This is basically pointer comparision in C++ days. how do I check that
A and B still point to the same object?

Chris


I knew I knew it.

If B is A then

end if

Chris
Nov 21 '05 #2
"I Don't Like Spam" <no@spam.com> schrieb:
Dim A as new object
Dim B as object
B = A

Do Bunch of stuff

Check if B still = A

This is basically pointer comparision in C++ days. how do I check that A
and B still point to the same object?


While the '=' operator is used to assign references, the 'Is' operator is
used to test for object identity (reference equality):

\\\

' Check for reference-equality.
If A Is B Then...

' Check for reference-inequality.
If Not A Is B Then...
If A IsNot B Then... ' VB 2005 only!
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

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

Similar topics

2
1472
by: Florian Lindner | last post by:
Hello, I've read the chapter in the Python documentation, but I'm interested in a a more in-depth comparision. Especially regarding how pythonic it is and how well it performs and looks under Windows. I've some C++ experiences with Qt, so I'm very interested to have PyQt compared to wxWindows and Tk. How fast does PyQt catches up with the versiones released from Trolltech? etc.. Thx, Florian
5
1634
by: Tommy Lang | last post by:
Hi! I am trying to write a function that goes through an array of objects(class Student) and checks if object name(student name)matches search string(char *). I want the function to return a pointer to the object, if a match is found. This is my code so far...(am I even close? :-)) //I want to return a ponter of type student
1
1732
by: John Black | last post by:
Hi, In using find_if() you need to name a comparision function which normally is a static function, but sometimes it is really inconvinient for this, let's take this example, class MyClass{ vector<int> myVec; void func(); };
3
1552
by: John Black | last post by:
Hi, I have 2 vectors, vector<Derived_class*> vec1, vec2; can I do the following, for (int i=0; i<vec1.size(); ++i){ for (int j=0; j<vec2.size(); ++j){ if (.. some comparision of vec1 and vec2...){ Base_Class b = vec2; vec2 = vec2; vec2 = b;
10
3458
by: techie | last post by:
I'm creating a class BookType that will store information about books. Each book type can have up to 4 authors. I defined a new type for an array of char: typedef char array4_t; This will hold 25 characaters I declared a 2 dimensional array of char in BookType:
2
2987
by: Ashwin Kambli | last post by:
Hi, I am doing a study on the performance comparision of C# and Java. Links to any articles on this topic will be greatly appreciated. Thanking you, Ashwin
3
1636
by: kd | last post by:
Hi All, How to perform case-insensitive comparision of strings? Would there be some kind of an indicator, which when set to true, would allow case-insenitive comparision of strings using if/select case, etc; after performing the case-insenisitive compare, the indicator can be reset to allow the conventional comparision of strings? kd
2
2661
by: nirav.lulla | last post by:
I have been given the task to come up with Requirements, Comparision and Migration document from Shadow Direct to DB2 Connect. I am very new much to all this, but kind of know a little bit about both of them. There has been a lot of pressure from business to move to DB2 Connect from Shadow Direct which the company is currently using since almost 7 years. I would greatly appreciate if any one of you can help or send me some comparision...
3
4271
by: abctech | last post by:
I have an Html page, user enters a Date (dd-mm-yyyy) here. There's a servlet connected in the backend for processing this submitted information, it must have a method to compare this entered date with the dates obtained from the backend table which again are retrieved as strings (dd-mm-yyyy). Can anyone suggest how to carry out comparision between these date strings? Eg: String Entered Date: "28-02-2007" String Backend Date:...
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8539
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.