Wednesday, August 11, 2010

Visual Basic String Statement : LSet

Purpose : Lset moves data from one string or user-defined type(UDT) to another. when LSet is used to move data from one variable to another, the data in the "from" variable is placed left justified in then "to" variable.

Syntax :
LSet s1 : s2

s1 : String or UDT that will receive the new data. It's the " to" variable.
s2 : String or UDT that will sending the data. It's the " from" variable.

Private Type OneType
a as string * 10
b as Integer
c as Long
End Type
Private Type TwoType
a as String * 10
b as Integer
c as Long
End Type

Private Sub cmdLSet_Click ()
Dim ot as OneType
Dim tt as TwoType
ot.a = "Arvind"
ot.b = 2
ot.c = 3

LSet tt = ot
Debug.Print tt.a , tt.b , tt.c

End Sub

Debug.Print return "Hi" 2 3

If Len ( Text1 ) < 20 Then
LSet sLeft = Text1
Picture1.Print "LSet : " ; Tab (30) ; sLeft
RSet sRight = Text1
Picture1.Print "RSet " " ; Tab (30) ; sRight
End If

This code show the difference between LSet and RSet string.

No comments:

Post a Comment