Qbasicnews.com

Full Version: Comments and compiling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Are comments, indentation and the like included in the 64K limit when you try to compile a program?
Here's a program that generates an 80kb bas file that's 99% comments. The resulting file compiles just fine. :o And I thought whitespace and comments counted. You learn something new every day.
Code:
OPEN "delme.bas" FOR OUTPUT AS #1

a$ = "'" + SPACE$(79)
FOR l% = 1 TO 1024
   PRINT #1, a$
NEXT l%

PRINT #1, "PRINT " + CHR$(34) + "Hello, World!!!" + CHR$(34)

CLOSE #1
Oh dear...

http://qbnz.com/pages/downloads/utilities/decomment.zip

:lol: My first release (started working on it on Wednesday).
Well, I was right there with you. I think we're all used to QB being not so intelligently designed... it's always a surprise when it is.
Well I think that the simple algo in the dl shows how easy it is to remove comments, and if the compiler wouldn't have removed the comments we would have been saying how crap the compiler was... evidently there are people with brains at microsoft :lol: