⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modlngnum.bas

📁 可以对无限长度的整数进行加、减
💻 BAS
字号:
Attribute VB_Name = "ModLngNum"
Private Function IsNum(ByVal Num As String) As Boolean
    Dim t As String * 1
    
    t = Left(Num, 1)
    Num = Right(Num, Len(Num) - 1)
    If Not (t = "-" Or (t >= "0" And t <= "9")) Then
        IsNum = False
        Exit Function
    End If
    Do While Num <> ""
        t = Left(Num, 1)
        Num = Right(Num, Len(Num) - 1)
        If Not (t >= "0" And t <= "9") Then
            IsNum = False
            Exit Function
        End If
    Loop
    IsNum = True
End Function

Public Function Plus(Num1 As String, Num2 As String) As String
    Dim Num As New LngNum
    
    If Not IsNum(Num1) Or Not IsNum(Num2) Then
        Plus = "输入错误"
        Exit Function
    End If
    Num.Number1 = Num1
    Num.Number2 = Num2
    Num.Plus
    Plus = Num.ResultGet
End Function

Public Function Minus(Num1 As String, Num2 As String) As String
    Dim Num As New LngNum
    
    If Not IsNum(Num1) Or Not IsNum(Num2) Then
        Minus = "输入错误"
        Exit Function
    End If
    Num.Number1 = Num1
    Num.Number2 = Num2
    Num.Subtraction
    Minus = Num.ResultGet
End Function

Public Function Multiply(Num1 As String, Num2 As String) As String
    Dim Num As New LngNum
    
    If Not IsNum(Num1) Or Not IsNum(Num2) Then
        Multiply = "输入错误"
        Exit Function
    End If
    Num.Number1 = Num1
    Num.Number2 = Num2
    Num.Multiply
    Multiply = Num.ResultGet
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -