VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



For changing Cases of the letters means upper case into lower case and lower case into upper case.

by Arsalan Mushtaq (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 22nd December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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.



 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


Download this snippet    Add to My Saved Code

For changing Cases of the letters means upper case into lower case and lower case into upper case. Comments

No comments have been posted about For changing Cases of the letters means upper case into lower case and lower case into upper case.. Why not be the first to post a comment about For changing Cases of the letters means upper case into lower case and lower case into upper case..

Post your comment

Subject:
Message:
0/1000 characters