04-07-2005, 04:47 AM
Realesing this as source, very compact..
What it does:
Removes un-used lines in a proggram. REMs and whitespaces
Reduces size of program (if there is anything to remove)
Leaves ('$INCLUDE's alone and unharmed..
Keeps a backup, or you can make it overwrite a file (Not Recomended, anything can happen).. :wink:
What it doesn't
PRINT "Hello" 'Remove a REM on the side of a line
Example:
Took Rlesoft's Julia Rings
From : 224 Lines of code..
To: 175 Lines of code..
And it still worked!!
Minus the "SLEEP 100" it should run in QB also.. Or for faster speeds, just for looks.. speed is good either way.. :wink:
Here it is...
Enjoy!!!!
What it does:
Removes un-used lines in a proggram. REMs and whitespaces
Reduces size of program (if there is anything to remove)
Leaves ('$INCLUDE's alone and unharmed..
Keeps a backup, or you can make it overwrite a file (Not Recomended, anything can happen).. :wink:
What it doesn't
PRINT "Hello" 'Remove a REM on the side of a line
Example:
Took Rlesoft's Julia Rings
From : 224 Lines of code..
To: 175 Lines of code..
And it still worked!!
Minus the "SLEEP 100" it should run in QB also.. Or for faster speeds, just for looks.. speed is good either way.. :wink:
Here it is...
Code:
PRINT "REM Line Remover 1000!"
PRINT
PRINT "No worries, checks for '$INCLUDE:, so that want be erased ;)"
PRINT
INPUT "File Name:(add extention also)", file$
INPUT "Resave REM free as:(add extention)", file2$
OPEN file$ FOR INPUT AS #1
OPEN file2$ FOR OUTPUT AS #2
DO
IF EOF(1) THEN EXIT DO
LINE INPUT #1, lineread$
IF MID$(UCASE$(lineread$), 1, 4) = "'$IN" THEN GOTO writelib
IF MID$(lineread$, 1, 1) = "'" THEN GOTO skipwrite
writelib:
IF lineread$ = "" THEN GOTO skipwrite
PRINT #2, lineread$
PRINT "Line Cept:", lineread$
SLEEP 100 'REMOVE this For more speed!
skipwrite:
LOOP
CLS
PRINT "All done! :D"
SLEEP
Enjoy!!!!