473,508 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LSET Equivalent

I have a code builder that I use for writing my VB6 classes. I ran the Code
Advisor on the generated code & found that LSet is not supported in VB.Net
I use this in a number of places in my methods to store the state of my
class properties in a copy of a udt

Here is an example of how I use it in my CancelEdit function.

=================================
Public Sub CancelEdit()
If m_booIsChild Then If Not m_booIsChildEditing Then Err.Raise 445
If Not m_booIsEditing Then Err.Raise 445

m_booIsEditing = False
m_booIsDeleted = False
m_booIsDirty = False

'Restore object state
LSet m_udtProps = m_udtSave
RaiseEvent NowClean
End Sub
=================================
m_udtProps is a udt that contains all my class properties
m_ustSave is a copy of this (got by using LSet m_udtSave = m_udtProps).
If I cancel my edit before saving, I can use the LSet function to reset my
m_udtProps to its original state before any edits were carried out.

Any ideas on how to easily convert this sort of code would be appreciated.

tia

Terry Holland

Nov 20 '05 #1
1 3027
* "Terry Holland" <th******@sgbgb.co.uk> scripsit:
I have a code builder that I use for writing my VB6 classes. I ran the Code
Advisor on the generated code & found that LSet is not supported in VB.Net
I use this in a number of places in my methods to store the state of my
class properties in a copy of a udt

Here is an example of how I use it in my CancelEdit function.

=================================
Public Sub CancelEdit()
If m_booIsChild Then If Not m_booIsChildEditing Then Err.Raise 445
If Not m_booIsEditing Then Err.Raise 445

m_booIsEditing = False
m_booIsDeleted = False
m_booIsDirty = False

'Restore object state
LSet m_udtProps = m_udtSave
RaiseEvent NowClean
End Sub
=================================
m_udtProps is a udt that contains all my class properties
m_ustSave is a copy of this (got by using LSet m_udtSave = m_udtProps).
If I cancel my edit before saving, I can use the LSet function to reset my
m_udtProps to its original state before any edits were carried out.


For classes, have a look at the interface 'ICloneable'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

14
7214
by: John | last post by:
Is there an equivalent of COM on Linux that I can get through Python. My need is to have some sort of language independent component framework. I can think of CORBA but I have to have a server...
2
3268
by: Michael Foord | last post by:
Please pardon my ignorance on this one - but I'm not certain how the sign bt is treated in python bitwise operators. I've trying to convert a javascript DES encryption routine into python. ...
3
2272
by: Robert Dodier | last post by:
Hello, Here's a thought that I'm sure has already occurred to someone else, I just can't find any record of it yet. An XML document is just a more verbose and clumsy representation of an...
6
6951
by: DH | last post by:
We have a VB6 windows application. It had LSet to assign a User_Defined Type, a string, into another User_Defined Type, an Array of String. It looked like Type tPTStrin PTString As String * 2...
2
2103
by: Michael | last post by:
Hi, In VB6 I wrote an application that had to read lots of fixed length disk records from another system. These records were divided up into many fixed length fields. In VB6 the easy solution...
7
3712
by: Tim Conner | last post by:
Hi, I am an ex-delphi programmer, and I having a real hard time with the following simple code (example ): Which is the equivalent to the following code ? var chars : PChar; sBack, s :...
10
7305
by: karch | last post by:
How would this C# contruct be represented in C++/CLI? Or is it even possible? PolicyLevel level = (enumerator->Current) as PolicyLevel; Thanks, Karch
9
4030
by: Alan Silver | last post by:
Hello, I'm converting some old VB6 code to use with ASP.NET and have come unstuck with the Asc() function. This was used in the old VB6 code to convert a character to its ASCII numeric...
14
2521
by: grid | last post by:
Hi, I have a certain situation where a particular piece of code works on a particular compiler but fails on another proprietary compiler.It seems to have been fixed but I just want to confirm if...
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7331
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
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7054
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
7501
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
5633
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
1564
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 ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.