| | |
Reputed number problem switch case statement
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2008
Posts: 17
Reputation:
Solved Threads: 3
Reputed number problem switch case statement
hai This is my code
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim i As String
i = TextBox1.Text
Dim x As Object
For Each x In i
Dim num As Integer
num = x.ToString()
Select Case num
Case 1
str1 = "R"
Case 2
str2 = "A"
Case 3
str3 = "V"
Case 4
str4 = "I"
Case 5
str5 = "N"
Case 6
str6 = "D"
Case 7
str7 = "R"
Case 8
str8 = "A"
Case 9
str9 = "N"
Case 0
str0 = "M"
case else
str11="O"
End Select
Next
Dim temp1, temp2 As String
temp1 = TextBox3.Text
temp2 = TextBox4.Text
TextBox2.Text = String.Concat(temp1, temp2, str1, str2, str3, str4, str5, str6, str7, str8, str9, str0,str11)
End Sub
i will enter 144 output RI it show me Last number leave it
my requirement is i will enter this kind of number check
last nearest number repeat at that time else case work
show string 'O' output like as RIO
send some idea about....
i need help from u all
by
srm.....
hai This is my code
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim i As String
i = TextBox1.Text
Dim x As Object
For Each x In i
Dim num As Integer
num = x.ToString()
Select Case num
Case 1
str1 = "R"
Case 2
str2 = "A"
Case 3
str3 = "V"
Case 4
str4 = "I"
Case 5
str5 = "N"
Case 6
str6 = "D"
Case 7
str7 = "R"
Case 8
str8 = "A"
Case 9
str9 = "N"
Case 0
str0 = "M"
case else
str11="O"
End Select
Next
Dim temp1, temp2 As String
temp1 = TextBox3.Text
temp2 = TextBox4.Text
TextBox2.Text = String.Concat(temp1, temp2, str1, str2, str3, str4, str5, str6, str7, str8, str9, str0,str11)
End Sub
i will enter 144 output RI it show me Last number leave it
my requirement is i will enter this kind of number check
last nearest number repeat at that time else case work
show string 'O' output like as RIO
send some idea about....
i need help from u all
by
srm.....
I think this is what you want:
vb Syntax (Toggle Plain Text)
Public Class Form1 Dim i As String Dim x As Object Dim phrase As String Dim num As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click i = TextBox1.Text For Each x In i num = x.ToString() Select Case num Case 1 phrase += "R" Case 2 phrase += "A" Case 3 phrase += "V" Case 4 phrase += "I" Case 5 phrase += "N" Case 6 phrase += "D" Case 7 phrase += "R" Case 8 phrase += "A" Case 9 phrase += "N" Case 0 phrase += "M" Case Else phrase += "O" End Select Next TextBox2.Text = phrase End Sub End Class
•
•
Join Date: Mar 2008
Posts: 17
Reputation:
Solved Threads: 3
To : Respected sir
Thank you very much sir for your quick and very useful reply. Finaly i have done my one problem.
This same solution if i will enter repeated number like as 222
first 2 i want display "A" if next strings come same 2's goto else part "o"
how i will to this some idea .......to me
Once again thank you
Thank you very much sir for your quick and very useful reply. Finaly i have done my one problem.
This same solution if i will enter repeated number like as 222
first 2 i want display "A" if next strings come same 2's goto else part "o"
how i will to this some idea .......to me
Once again thank you
Last edited by ravindransrm; May 10th, 2009 at 5:47 am.
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Convert string variable into form object
- Next Thread: importing from text file to access using .net
| Thread Tools | Search this Thread |
.net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dropdownlist excel fade file-dialog folder ftp generatetags google hardcopy image images input insert intel internet login mobile monitor ms net networking objects opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial shutdown soap string survey tcp temperature text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





