Qbasicnews.com

Full Version: C Style commenting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Create a Q(uick)Basic program to scan an inputted file for "C" style comments (eg // for one-line comments and /* */ for multiline comments) and remove them.

The program should be able to remove comments from any type of file that uses C style comments, including PHP and CSS files etc.

Bonus points given for a program that can have inputted many different types of one-line and multiline comments and remove them all.

There's no time limit yet, until I see how popular this is Wink

Go Smile
Like remline.bas for c/c++?
Sorta. That removes line numbers, I want a program to remove comments.
I hate to play the devil's advocate :evil: but // is C++, not C Wink

...and this is way too easy for anyone with a basic (no pun intended) understanding of string manipulation Wink :lol:

I'll make one when I have the time.
And I'll try.
Should I post it here, or PM it?
Well then, ado, we'll see a winning entry from you then, won't we? :lol:

And... whatever about the //. That's a comment in PHP, and it's a one line comment, so it's a good thing to add. Don't forget, for bonus points I want a proggie that I can input the remarks into and it will work anyway, so I'll be trying with ' and REM as well :lol:

Please PM the answers to me, do not post them here, that sorta ruins it Smile
# is also a comment in PHP and it's less typing than // Tongue
Is it really? Well, there's my new thing for today Smile

... I haven't seen it mentioned before, is it completely legal, etc?
Yeah, # is used pretty often in other stuff as well...coders who write custom INI file handlers and whatnot tend to use # as a comment line. I think, but I'm not 100% sure, that it's used in Perl as well...but like i said, I dunno for sure.........

After I finish up this new website, I'll take out a couple days out of my vacation to write up a lil sumthin and send it to ya. Big Grin
Pages: 1 2 3 4 5