Does anyone know of a tool (like an addin) that will get rid of line numbers in the source code. I'm working on code that was taken from VB3 and there are line numbers galore in it that i'd like to get rid of.
Thanks,
Printable View
Does anyone know of a tool (like an addin) that will get rid of line numbers in the source code. I'm working on code that was taken from VB3 and there are line numbers galore in it that i'd like to get rid of.
Thanks,
I have not used VB3, however, I'm sure you can design your own program to do this. For instance, it will read the file line by line and subract every letter before a semi-colon (assuming the lines appear as follows)
Code:10: Me.Caption = "Hello"
20: Me.BackColor = vbBlue
30: Me.ForeColor = vbGreen
Megatron is too young to remember line numbers :)
They don't need to have a colon. Line labels do however which is what you're thinking of. I don't know if VB3 supported labels.
Megatron's suggestion is still valid however. Just look on every line of code to see if
Without testing it, the code above looks like it should get you somewhere.Code:If Instr(1,"0123456789",Left(line,1))<>0 Then
line = mid(line,instr(1," :",line))
End If
Let us know how you get on or if you need more help.
Regards
Thanks guys, Yeah i'll try that code, was jsut looking for the easy way with a per-written adin, but i could write my own.
Paul, in that code the line:
is still looking for a space-colon, but that need not exist i think. But i know it's just off the top of your head and i'm not picking. Basically the answer is to write some code to do it myself - so thats no probs, i can do that.Code:line = mid(line,instr(1," :",line))
Yeah vb3 does support line labels, unfortunately in my case. This vb3 app uses GoTo left right and centre. It even uses unconditional GoTo's to implement loops - scary...
First step is to get rid of line numbers, second step use (i think Serge's) VBFormat to make the code look nice, third step: hope that 1 and 2 make it easier to understand...
Anyway, thanks again...
Err.. Yes you are right. I tried to use InStr to do what I have my own function to do. I have a simple function that returns the first or last occurrence of any of the characters in the search string.
Using InStr I need to use two commands etc. But you got the picture which is fine...
Cheers