checking for comments

ritesh2190

Member
Joined
Jun 7, 2011
Messages
15
Programming Experience
1-3
i am writing a vb.net program which gets a c program as an input and checks it for errors,now i want my program to skip the comments in the c program,i have written some code but its not working pls tell me where i have gone wrong,or if u have any ideas pls let me know
For Each line In TextBox1.Lines
            sample = TextBox1.Lines(k)
            Dim len As String
            len = sample.Length
            comm = InStr(sample, "/*")
            If comm <> 0 Then
                comm = 0
                Do While comm = 0
                    For Each line1 In TextBox1.Lines(k)
                        sample = TextBox1.Lines(k)
                        len = sample.Length
                        For i = 0 To len - 1
                            comm = InStr(sample, "*/")
                        Next
                        If comm <> 0 Then
                            Exit Do
                        End If
                        k = k + 1
                    Next
                Loop
                Next
            End If
 
Last edited by a moderator:
but what is wrong with my code???
my program checks line by line for errors so it has to skip those lines which are commented out.i ll include // later if this is a success first!
 
but what is wrong with my code???
my program checks line by line for errors so it has to skip those lines which are commented out.i ll include // later if this is a success first!
 
Back
Top