Sebelumnya saya pernah memposting beberapa VB6 Tools, salah satu yang dianggap bermanfaat diantaranya adalah Manifest Creator yang dibuat LaVolpe.
Kali ini masih mengenai VB6 tools yang berguna untuk men-tidy code-code VB6. Contoh kode:
Private Sub GetProfilIDAndBloggerID(TextXML As String) Dim child As IXMLDOMNode Dim x As New DOMDocument x.loadXML TextXML Dim strID As String Dim i As Integer ' Add the child nodes ReDim strIDAndProfiles(0) For Each child In x.documentElement.childNodes If child.NodeName = "entry" Then For i = 0 To child.childNodes.Length - 1 If child.childNodes(i).NodeName = "id" Then strID = child.childNodes(i).Text If Trim$(strID) <> "" Then strIDAndProfiles(UBound(strIDAndProfiles)) = strID End If ReDim Preserve strIDAndProfiles(UBound(strIDAndProfiles) + 1) End If Next End If Next If blnFromFile = False Then strPathXML = App.Path & "\" & strTitle & ".XML" End If Dim b As Integer frmBlog.List1.Clear If UBound(strIDAndProfiles) > 0 Then For i = 0 To UBound(strIDAndProfiles) If Trim$(strIDAndProfiles(i)) <> "" Then frmBlog.List1.AddItem strIDAndProfiles(i) End If Next End If With frmBlog If .List1.ListCount > 1 Then .Show vbModal, frmMain strID = .List1.List(.List1.ListIndex) Else strID = .List1.List(0) End If End With i = InStr(1, strID, "user-") b = InStr(1, strID, "blog-") strBlogID = Mid$(strID, b + 5, 19) strProfileID = Mid$(strID, i + 5, Len(strID) - (b + 3)) Set x = Nothing End SubMelihat kode di atas, tidak Anda kesulitan membacanya? Nah, dengan tools ini Anda akan mudah meng-indentnya secara tepat, sehingga menjadi:
Private Sub GetProfilIDAndBloggerID(TextXML As String)
Dim child As IXMLDOMNode
Dim x As New DOMDocument
x.loadXML TextXML
Dim strID As String
Dim i As Integer
' Add the child nodes
ReDim strIDAndProfiles(0)
For Each child In x.documentElement.childNodes
If child.NodeName = "entry" Then
For i = 0 To child.childNodes.Length - 1
If child.childNodes(i).NodeName = "id" Then
strID = child.childNodes(i).Text
If Trim$(strID) <> "" Then
strIDAndProfiles(UBound(strIDAndProfiles)) = strID
End If
ReDim Preserve strIDAndProfiles(UBound(strIDAndProfiles) + 1)
End If
Next
End If
Next
If blnFromFile = False Then
strPathXML = App.Path & "\" & strTitle & ".XML"
End If
Dim b As Integer
frmBlog.List1.Clear
If UBound(strIDAndProfiles) > 0 Then
For i = 0 To UBound(strIDAndProfiles)
If Trim$(strIDAndProfiles(i)) <> "" Then
frmBlog.List1.AddItem strIDAndProfiles(i)
End If
Next
End If
With frmBlog
If .List1.ListCount > 1 Then
.Show vbModal, frmMain
strID = .List1.List(.List1.ListIndex)
Else
strID = .List1.List(0)
End If
End With
i = InStr(1, strID, "user-")
b = InStr(1, strID, "blog-")
strBlogID = Mid$(strID, b + 5, 19)
strProfileID = Mid$(strID, i + 5, Len(strID) - (b + 3))
Set x = Nothing
End Sub
Cara menggunakan: - Ekstrak terlebih dahulu
- Klik Install.bat
- Buka project VB6 apa saja (terserah)
- Klik Menu Add-Ins, pada menu ini Anda akan menemukan sebuah menu baru yaitu menuu Rapikan Kode
- Klik Rapikan Kode
- Beri centang pada CheckBox Rapikan Seluruhnya untuk merapikan seluruh kode yang ada pada Project