473,324 Members | 2,166 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,324 software developers and data experts.

How to convert LSet in VB6 to VB.Net

DH
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
End Typ

Type tPTArra
PTArray (11) As String *
End Typ

Dim PTS as tPTStrin
Dim PTA As tPTArra

PTS.PTString = "ABCDEFGHIJKLMNOPQRSTU" '--22 character

LSet PTA = PT

We got PTA.PTArray(0) = "AB", PTA.PTArray(2) ="CD",...... PTA.PTArray(11) = "TU"

What correspodent Function of LSet of VB6 we can use in VB.Net (or sample code)

Thanks

Jul 21 '05 #1
6 6939
Hi,

http://msdn.microsoft.com/library/de...angesinvb7.asp

Ken
-------------
"DH" <an*******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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 tPTString
PTString As String * 22
End Type

Type tPTArray
PTArray (11) As String *2
End Type

Dim PTS as tPTString
Dim PTA As tPTArray

PTS.PTString = "ABCDEFGHIJKLMNOPQRSTU" '--22 characters

LSet PTA = PTS

We got PTA.PTArray(0) = "AB", PTA.PTArray(2) ="CD",...... PTA.PTArray(11)
= "TU".

What correspodent Function of LSet of VB6 we can use in VB.Net (or sample
code)?

Thanks.

Jul 21 '05 #2
Hi,

http://msdn.microsoft.com/library/de...angesinvb7.asp

Ken
-------------
"DH" <an*******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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 tPTString
PTString As String * 22
End Type

Type tPTArray
PTArray (11) As String *2
End Type

Dim PTS as tPTString
Dim PTA As tPTArray

PTS.PTString = "ABCDEFGHIJKLMNOPQRSTU" '--22 characters

LSet PTA = PTS

We got PTA.PTArray(0) = "AB", PTA.PTArray(2) ="CD",...... PTA.PTArray(11)
= "TU".

What correspodent Function of LSet of VB6 we can use in VB.Net (or sample
code)?

Thanks.

Jul 21 '05 #3
Unfortunately Ken's link just says you can't do it in .net without really
giving you any help on where to go next

basically this is not a "typesafe" operation - you are taking a block of
memory and trying to treat it in different ways. .net does not allow you to
just play fast and loose with pieces of memory like this.

you will need to rewrite the code to represent the data in another way. for
instance you could have an arraylist of 2 character strings and then write a
method to produce the long version on demand, or you could have a single
StringBuffer and write a method to return or replace any two-character pair.

I suspect if you look at the requirement you will find out that the original
way of doing it was not a great solution and you will be able to find a much
better one using .net.

if the reason it was written like this was to give very fast performance,
you might need to experiment with several ways to do it.

Andy

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...angesinvb7.asp
Ken
-------------
"DH" <an*******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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 tPTString
PTString As String * 22
End Type

Type tPTArray
PTArray (11) As String *2
End Type

Dim PTS as tPTString
Dim PTA As tPTArray

PTS.PTString = "ABCDEFGHIJKLMNOPQRSTU" '--22 characters

LSet PTA = PTS

We got PTA.PTArray(0) = "AB", PTA.PTArray(2) ="CD",...... PTA.PTArray(11) = "TU".

What correspodent Function of LSet of VB6 we can use in VB.Net (or sample code)?

Thanks.


Jul 21 '05 #4
Unfortunately Ken's link just says you can't do it in .net without really
giving you any help on where to go next

basically this is not a "typesafe" operation - you are taking a block of
memory and trying to treat it in different ways. .net does not allow you to
just play fast and loose with pieces of memory like this.

you will need to rewrite the code to represent the data in another way. for
instance you could have an arraylist of 2 character strings and then write a
method to produce the long version on demand, or you could have a single
StringBuffer and write a method to return or replace any two-character pair.

I suspect if you look at the requirement you will find out that the original
way of doing it was not a great solution and you will be able to find a much
better one using .net.

if the reason it was written like this was to give very fast performance,
you might need to experiment with several ways to do it.

Andy

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...angesinvb7.asp
Ken
-------------
"DH" <an*******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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 tPTString
PTString As String * 22
End Type

Type tPTArray
PTArray (11) As String *2
End Type

Dim PTS as tPTString
Dim PTA As tPTArray

PTS.PTString = "ABCDEFGHIJKLMNOPQRSTU" '--22 characters

LSet PTA = PTS

We got PTA.PTArray(0) = "AB", PTA.PTArray(2) ="CD",...... PTA.PTArray(11) = "TU".

What correspodent Function of LSet of VB6 we can use in VB.Net (or sample code)?

Thanks.


Jul 21 '05 #5
Hi,

Add Imports Microsoft.VisualBasic to the top of your file so vb.net knows
where to find lset.

Ken
----------------

"Andy Fish" <aj****@blueyonder.co.uk> wrote in message
news:8g*********************@news-text.cableinet.net...
Unfortunately Ken's link just says you can't do it in .net without really
giving you any help on where to go next

basically this is not a "typesafe" operation - you are taking a block of
memory and trying to treat it in different ways. .net does not allow you
to
just play fast and loose with pieces of memory like this.

you will need to rewrite the code to represent the data in another way.
for
instance you could have an arraylist of 2 character strings and then write
a
method to produce the long version on demand, or you could have a single
StringBuffer and write a method to return or replace any two-character
pair.

I suspect if you look at the requirement you will find out that the
original
way of doing it was not a great solution and you will be able to find a
much
better one using .net.

if the reason it was written like this was to give very fast performance,
you might need to experiment with several ways to do it.

Andy

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...angesinvb7.asp

Ken
-------------
"DH" <an*******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
> 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 tPTString
> PTString As String * 22
> End Type
>
> Type tPTArray
> PTArray (11) As String *2
> End Type
>
> Dim PTS as tPTString
> Dim PTA As tPTArray
>
> PTS.PTString = "ABCDEFGHIJKLMNOPQRSTU" '--22 characters
>
> LSet PTA = PTS
>
> We got PTA.PTArray(0) = "AB", PTA.PTArray(2) ="CD",...... PTA.PTArray(11) > = "TU".
>
> What correspodent Function of LSet of VB6 we can use in VB.Net (or sample > code)?
>
> Thanks.
>



Jul 21 '05 #6
Hi,

Add Imports Microsoft.VisualBasic to the top of your file so vb.net knows
where to find lset.

Ken
----------------

"Andy Fish" <aj****@blueyonder.co.uk> wrote in message
news:8g*********************@news-text.cableinet.net...
Unfortunately Ken's link just says you can't do it in .net without really
giving you any help on where to go next

basically this is not a "typesafe" operation - you are taking a block of
memory and trying to treat it in different ways. .net does not allow you
to
just play fast and loose with pieces of memory like this.

you will need to rewrite the code to represent the data in another way.
for
instance you could have an arraylist of 2 character strings and then write
a
method to produce the long version on demand, or you could have a single
StringBuffer and write a method to return or replace any two-character
pair.

I suspect if you look at the requirement you will find out that the
original
way of doing it was not a great solution and you will be able to find a
much
better one using .net.

if the reason it was written like this was to give very fast performance,
you might need to experiment with several ways to do it.

Andy

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...angesinvb7.asp

Ken
-------------
"DH" <an*******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
> 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 tPTString
> PTString As String * 22
> End Type
>
> Type tPTArray
> PTArray (11) As String *2
> End Type
>
> Dim PTS as tPTString
> Dim PTA As tPTArray
>
> PTS.PTString = "ABCDEFGHIJKLMNOPQRSTU" '--22 characters
>
> LSet PTA = PTS
>
> We got PTA.PTArray(0) = "AB", PTA.PTArray(2) ="CD",...... PTA.PTArray(11) > = "TU".
>
> What correspodent Function of LSet of VB6 we can use in VB.Net (or sample > code)?
>
> Thanks.
>



Jul 21 '05 #7

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

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
1
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance...
2
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...
4
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
1
by: Terry Holland | last post by:
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...
3
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...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.