سلام شباب...رجعت ام الاسئله....عندي برنامج صغيرن وبسيط...
الزبده مالته انه اذا دخلنا رقم بالارقام...يطبع لنا رقم بالحروف...
يعني اذا كان هذا اللي دخلناه 52...يطلع لنا جدي..fifty two...
المشكله ان في بعض الارقام تطلع غلط...مثل 55...46....وبعدين ما عرفت اواصل للمئات...كله يطلع لي اخطاء...
بس اذا في احد يتلطف ويساعدني ويشوف وين الخلل اللي في البرنامج ويكمل لي الجزء الناقص...
مشكووووووووووووورن شباب مقدما...واللي يسوي لي البرنامج الله يعطيه العافيه يجازيه خير...
شيطووووووووووووونه...
هذا هو الكود...
Dim units(10) As String
Dim teens(10) As String
Dim tens(10) As String
Dim fullword As String
Dim x, y, z As Integer
Private Sub Command1_Click()
Text1.Text = ""
Label2.Caption = ""
End Sub
Private Sub Command2_Click()
x = Val(Text1)
If x < 10 Then
y = x
fullword = units(x)
Else
If x > 10 And x < 20 Then
y = x - 10
fullword = teens(y)
Else
If x Mod 10 = 0 Then
y = x / 10
fullword = tens(y)
Else
y = x / 10
z = x Mod 10
If x > 20 And x < 40 Then
fullword = tens(y) & " " & units(z)
Else
fullword = tens(y - 1) & " " & units(z)
End If
End If
End If
End If
Label2.Caption = fullword
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
units(0) = ""
units(1) = "One"
units(2) = "Two"
units(3) = "Three"
units(4) = "Four"
units(5) = "Five"
units(6) = "Six"
units(7) = "Seven"
units(8) = "Eight"
units(9) = "Nine"
tens(0) = ""
tens(1) = "Ten"
tens(2) = "Twenty"
tens(3) = "Thirty"
tens(4) = "Fourty"
tens(5) = "Fifty"
tens(6) = "Sixty"
tens(7) = "Seventy"
tens(8) = "Eighty"
tens(9) = "Ninty"
teens(0) = ""
teens(1) = "Eleven"
teens(2) = "Twelve"
teens(3) = "Thirteen"
teens(4) = "Fourteen"
teens(5) = "Fifteen"
teens(6) = "Sixteen"
teens(7) = "Seventeen"
teens(8) = "Eighteen"
teens(9) = "Ninteen"
End Sub
