我正在分析大量的C代码,并希望将其拆分为模块。有没有办法自动生成C函数列表,从最长的函数开始?
答案 0 :(得分:0)
如果我们可以假设带有函数声明的行没有缩进,以Sub arrtest()
Dim arr() As String
Dim t&, i&, lastrow&, firstrow&
With ActiveWorkbook.Worksheets("Sheet1")
lastRow = .Cells(.Rows.count, "A").End(xlUp).Row
For t = 6 To lastRow
If .Cells(t, 4) <> 9999999 Then
firstrow = t - 6
Exit For
End If
Next
ReDim arr(firstrow To firstrow)
For i = 6 To lastRow
If .Cells(i, 4) <> 9999999 Then
ReDim Preserve arr(firstrow To UBound(arr) + 1)
arr(UBound(arr)) = .Cells(i, 2).value
End If
Next
For t = LBound(arr) To UBound(arr)
Debug.Print arr(t)
Next
End With
End Sub
结尾,函数定义以非缩进{
结尾,这个Python片段可以帮助:
}