Excel VBA, I'm having a problem with an excel macro with function
` StrComp(FileLine, "*/")`
The purpose of the code is to find duplicates in an .h file.
And I want to exclude all commented declarations, so I've added this piece of code:
VarIsAComment = StrComp(FileLine, "//#define", vbTextCompare)
and it's working fine, but the problem starts when I try to find comment with "/*".. I've tryied this code:
While Not EOF(1)
Line Input #1, FileLine
CurLineNum = CurLineNum + 1
If (StrComp(FileLine, "#define", vbBinaryCompare)) Then
VarIsAComment = StrComp(FileLine, "//#define", vbTextCompare) //Woks fine
If (StrComp(FileLine, "/*")) Then CommentStarted = 1 //not working
If (StrComp(FileLine, "*/")) Then CommentStarted = 0
So the problem is that if FileLine is something like this:
#define mBlk bytem[12]/*comment*/
it works fine, but when FileLine is only /* CommentStarted stays to false and then goes to true only on the next line and then returns to false in the same cycle.
Any idea?
Thanks