Hilfe bei Visual Basic Kommentierung

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Hilfe bei Visual Basic Kommentierung

    Hallo,

    ich bräuchte etwas Hilfe bei der Kommentierung meines Visual Basic Quelltextes.
    Und zwar habe ich mir bei der Datenbank helfen lassen, bräuchte aber nun etwas Hilfe um das ganze besser zu verstehen.

    Es wäre lieb, wenn ihr mir die wichtigsten Befehle kommentieren könntet.

    Nun zum Quelltext.

    Source Code

    1. Private Sub Befehl14_Click()
    2. Dim rs As Recordset
    3. Dim b_arr() As String
    4. Dim icd_arr() As String
    5. Dim lv, av, ind, anzahl, slange As Integer
    6. Dim b_str, icd_str As String
    7. Dim pos, t_pos, pos_1 As Long
    8. Dim f_arr() As String
    9. Dim icd_t_str, t_str As String
    10. Dim tmp_str
    11. Liste11.RowSource = vbEmptyString
    12. Set rs = CurrentDb.OpenRecordset("SELECT BID FROM Diagnose WHERE DID = '" & Text0.Value & "' GROUP BY BID", dbOpenDynaset)
    13. Do While Not rs.EOF
    14. If b_str <> "" Then
    15. b_str = b_str & ";" & rs.Fields("BID")
    16. Else
    17. b_str = rs.Fields("BID")
    18. End If
    19. rs.MoveNext
    20. Loop
    21. rs.Close
    22. b_arr = Split(b_str, ";")
    23. b_str = ""
    24. For lv = 0 To UBound(b_arr)
    25. Set rs = CurrentDb.OpenRecordset("SELECT a.DID as IC, b.Beschreibung as INAME FROM Diagnose as a, ICD as b WHERE a.BID=" & b_arr(lv) & " AND a.DID<>'" & Text0.Value & "' AND b.Code=a.DID ORDER BY b.Beschreibung", dbOpenDynaset)
    26. Do While Not rs.EOF
    27. If icd_str <> "" Then
    28. icd_str = icd_str & ";" & rs.Fields("IC") & " " & Trim(rs.Fields("INAME"))
    29. Else
    30. icd_str = rs.Fields("IC") & " " & Trim(rs.Fields("INAME"))
    31. End If
    32. rs.MoveNext
    33. Loop
    34. rs.Close
    35. Next lv
    36. Erase b_arr
    37. icd_arr = Split(icd_str, ";")
    38. For av = 0 To UBound(icd_arr)
    39. icd_t_str = icd_arr(av) & ";"
    40. slange = Len(icd_arr(av))
    41. pos = InStr(icd_str, icd_arr(av))
    42. pos_1 = pos + Len(icd_t_str)
    43. If pos > 0 And Mid(icd_str, pos, pos_1 - pos + 1) <> Trim(icd_arr(av)) & " (" Then
    44. anzahl = 0
    45. Do While pos > 0
    46. anzahl = anzahl + 1
    47. t_pos = pos + slange
    48. pos = InStr(t_pos, icd_str, icd_arr(av))
    49. Loop
    50. icd_str = Replace(icd_str, icd_arr(av), "TEMP", 1, 1)
    51. icd_str = Replace(icd_str, icd_arr(av), vbNullString)
    52. icd_str = Replace(icd_str, "TEMP", icd_arr(av) & " (" & anzahl & ")")
    53. End If
    54. Next av
    55. Erase icd_arr
    56. f_arr = Split(icd_str, ";")
    57. icd_str = ""
    58. For Each tmp_str In f_arr
    59. If tmp_str <> vbNullString Then Liste11.AddItem tmp_str
    60. Next
    61. Liste11.Visible = True
    62. End Sub
    Display All


    Vielen Dank für eure Hilfe.

    Gruß Thomas.