Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb6 LSet conversion to vb.net

Status
Not open for further replies.

tomz1

Programmer
Joined
Oct 14, 2003
Messages
2
Location
US

I have a vb6 appl that I am converting to vb.net. I am having trouble replacing/converting vb6 use of the LSet stmt (LSet is not supported in vb.net). Does anyone have any ideas?
Thanks!

The vb6 code uses the following public types:
Public Type SecurityAccessProps
strUserName As String * 30
strApplID As String * 30
strApplType As String * 1
strApplDesc As String * 50
lngAccessLevel As Long
dtDateLastUpdated As Date
strLastUpdatedBy As String * 30
dtDateCreated As Date
strCreatedBy As String * 30
blnIsNew As Boolean
blnIsDeleted As Boolean
blnIsDirty As Boolean
End Type

Public Type SecurityAccessBuffer
strBuffer As String * 186
End Type
_____________________________________________________

The vb6 code is as follows:

Private mudtProps As SecurityAccessProps

Private Sub SetState(strBuffer As String)
Const SUB_NAME = "SetState"
Dim udtData As SecurityAccessBuffer

udtData.strBuffer = strBuffer
LSet mudtProps = udtData
End Sub

Private Function GetState() As String
Const SUB_NAME = "GetState"
Dim udtData As SecurityAccessBuffer

LSet udtData = mudtProps
GetState = udtData.strBuffer

End Function

Is there a way in vb6 to re-write/replace the LSet stmt so the udtdata string buffer can be assigned the SecurityAccessType data and vice versa for the SetState & GetState functions? I need to keep the String functionality of the SetState & GetState functions.
OR ...
Is there a way to convert this code to vb.net without the LSet stmt? Again, I need to keep SetState & GetState as Strings.

Thanks
Tomz
 
The LSet and RSet functions have been replaced with the String.PadLeft and String.PadRight shared functions. These functions also provide you with the ability to define the padding character.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top