1. 首页
  2. 编程语言
  3. VB
  4. 一个有趣的VB小程序

一个有趣的VB小程序

上传者: 2018-12-28 16:34:05上传 ZIP文件 1.99KB 热度 50次
Private Sub Command1_Click() 'On Error GoTo err Dim line_all As Double Dim jgtemp As String Dim jg As String Dim line_zensu As Integer Dim dot As Integer Dim zensu As Integer Dim mon As String 'If Me.MaskEdBox1.Text "." Then line_all = CDbl(Me.Text1.Text) mon = CStr(line_all) line_all = Len(mon) dot = InStr(mon, ".") line_zensu = line_all - dot If (line_all - dot) < 2 Then mon = mon & "0" 'MsgBox CStr(line_all) & CStr(dot) 'MsgBox mon For i = 0 To line_all - 1 ' ' If i < line_all - 1 Then word = Mid(mon, line_all - i, 1) ' Else ' word = Mid(mon, line_all, 1) ' End If If word "." Then 'word = Mid(mon, i, 1) jg = return2(i + 1) & jg jg = return1(word) & jg jgtemp = jg & jgtemp 'Else: i = i - 1 ' End If End If Next i MsgBox jg Exit Sub 'End If err: 'MsgBox err.Number If err.Number = 13 Then MsgBox "非法字符", vbExclamation Exit Sub End Sub Function return1(s As String) As String return1 = zw(CInt(s)) End Function Function return2(d As Integer) As String If i < 3 Then return2 = dw(d - 1) Else return2 = dw(d - 2) End If End Function If i < line_all - 1 Then word = Mid(mon, line_all - i, 1) ' Else ' word = Mid(mon, line_all, 1) ' End If If word "." Then 'word = Mid(mon, i, 1) jg = return2(i + 1) & jg jg = return1(word) & jg jgtemp = jg & jgtemp 'Else: i = i - 1 ' End If End If Next i MsgBox jg Exit Sub 'End If err: 'MsgBox err.Number If err.Number = 13 Then MsgBox "非法字符", vbExclamation Exit Sub End Sub Function return1(s As String) As String return1 = zw(CInt(s)) End Function Function return2(d As Integer) As String If i < 3 Then return2 = dw(d - 1) Else return2 = dw(d - 2) End If End Function
用户评论
码姐姐匿名网友 2018-12-28 16:34:05

很好的东西,喜欢,这个小程序不错哦!