- Home
·
- Miscellaneous
·
- For changing Cases of the letters means upper case into lower case and lower case into upper case.
For changing Cases of the letters means upper case into lower case and lower case into upper case.
For changing Cases of the letters means upper case into lower case and lower case into upper case.
API Declarations
Dim Lenth As Integer
Dim Counter As Integer
Dim DataChr As String * 1
Dim AscValue As Integer
Dim Ans As String
Rate For changing Cases of the letters means upper case into lower case and lower case into upper case.
(1(1 Vote))
Ans = ""
Lenth = Len(WorkStr)
For Counter = 1 To Lenth
DataChr = Mid(WorkStr, Counter, 1)
AscValue = Asc(DataChr)
If Conversion = vbUpperCase Then
If AscValue >= 97 And AscValue <= 122 Then
AscValue = AscValue - 32
End If
ElseIf Conversion = vbLowerCase Then
If AscValue >= 65 And AscValue <= 90 Then
AscValue = AscValue + 32
End If
ElseIf Conversion = vbProperCase Then
If Counter = 1 Then
If AscValue >= 97 And AscValue <= 122 Then
AscValue = AscValue - 32
End If
ElseIf DataChr = " " Then
Counter = Counter + 1
DataChr = Mid(WorkStr, Counter, 1)
AscValue = Asc(DataChr)
If AscValue >= 97 And AscValue <= 122 Then
AscValue = AscValue - 32
End If
ElseIf AscValue >= 65 And AscValue <= 90 Then
AscValue = AscValue + 32
End If
End If
DataChr = Chr(AscValue)
Ans = Ans & DataChr
Next
Text1.Text = Ans
End Sub
Private Sub cmdClear_Click()
txtStr = ""
Text1.Text = ""
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdLower_Click()
DataStr = txtStr
Call MyStrConv(DataStr, vbLowerCase)
End Sub
Private Sub cmdProper_Click()
DataStr = txtStr
Call MyStrConv(DataStr, vbProperCase)
End Sub
Private Sub cmdUpper_Click()
DataStr = txtStr
Call MyStrConv(DataStr, vbUpperCase)
End Sub
Private Sub lblAns_Click()
End Sub
Private Sub Command1_Click()
DataStr = txtStr
Call MyStrConv(DataStr, vbProperCase)
End Sub
Private Sub Command2_Click()
Text1.Text = txtStr
End Sub
Private Sub Form_Load()
End Sub
For changing Cases of the letters means upper case into lower case and lower case into upper case. Comments
No comments yet — be the first to post one!
Post a Comment