• macro


    Sub aa()
    Dim i As Integer

    Dim strData, str1, str2, str3, str4, str5, strtmp As String

    Dim strcomment As String

    startRow = 0
    str1 = "@Schema(title = ""$$"")"
    str2 = "@Column(name = ""$1"", columnDefinition = ""$2 DEFAULT NULL COMMENT '$3 ' "")"
    str3 = "private String eventVersion;"
    str4 = "@Column(name = ""$1"", columnDefinition = ""$2 COMMENT '$3 ' "")"

    For i = 2 To 1000

    If Cells(i, 1) = "カラム名 (?理名)" Then
    startRow = i + 1
    End If

    Next

    strData = ""
    startRow = 7
    If startRow > 0 Then
    For i = startRow To 1000
    If (Cells(i, 1) = "") Then
    Exit For
    End If
     
    strData = strData & Chr(13) & Replace(str1, "$$", Cells(i, 1))
    If Cells(i, 7) = "○" Then
    str5 = str2
    Else
    str5 = str4
    End If
     
    strcomment = Replace(Cells(i, 13), Chr(10), "")
     
    If Cells(i, 3) = "int" Then
    strtmp = Replace(str5, "$1", Cells(i, 2))
    strtmp = Replace(strtmp, "$2", "Integer")
    strtmp = Replace(strtmp, "$3", strcomment)
    strData = strData & Chr(13) & strtmp
    strData = strData & Chr(13) & "private Integer " & tuoFeng(LCase(Cells(i, 2))) & ";"
    ElseIf Cells(i, 3) = "timestamp" Then
    strtmp = Replace(str5, "$1", Cells(i, 2))
    strtmp = Replace(strtmp, "$2", "datetime")
    strtmp = Replace(strtmp, "$3", strcomment)
    strData = strData & Chr(13) & strtmp
    strData = strData & Chr(13) & "private Date " & tuoFeng(LCase(Cells(i, 2))) & ";"
    ElseIf InStr(1, Cells(i, 3), "varchar") > 0 Then
    strtmp = Replace(str5, "$1", Cells(i, 2))
    strtmp = Replace(strtmp, "$2", "varchar(" & Cells(i, 4) & ")")
    strtmp = Replace(strtmp, "$3", strcomment)
    strData = strData & Chr(13) & strtmp
    strData = strData & Chr(13) & "private String " & tuoFeng(LCase(Cells(i, 2))) & ";"
    Else
    strData = strData & Chr(13) & "eror line " & Cells(i, 2) & ";"
     
    End If
     
    strData = strData & Chr(13)
    Next

    End If

    Debug.Print strData

    'Debug.Print Str(Add1(1, 2))

    End Sub
    Function Add1(num1 As Integer, num2 As Integer) As Integer
    Add1 = num1 + num2
    End Function

    Function tuoFeng(num1 As String) As String
    Dim preValue, finValue As String
    preValue = num1
    finValue = Replace(preValue, "_", " ")
    finValue = StrConv(finValue, vbProperCase)
    finValue = Replace(finValue, " ", "")
     
    finValue = LCase(Left(finValue, 1)) & Right(finValue, Len(finValue) - 1)
     
    tuoFeng = finValue
    End Function


  • 相关阅读:
    lintcode254- Drop Eggs- easy
    lintcode462- Total Occurrence of Target- easy
    lintcode63- Search in Rotated Sorted Array II- medium
    lintcode62- Search in Rotated Sorted Array- medium
    lintcode74- First Bad Version- medium
    lintcode75- Find Peak Element- medium
    lintcode160- Find Minimum in Rotated Sorted Array II- medium
    lintcode159- Find Minimum in Rotated Sorted Array- medium
    lintcode447- Search in a Big Sorted Array- medium
    VS2005、vs2008+WinXPDDK+DDKWizard配置驱动开发环境 分类: VC++ 2015-01-05 09:38 448人阅读 评论(0) 收藏
  • 原文地址:https://www.cnblogs.com/dunkbird/p/15801941.html
Copyright © 2020-2023  润新知