Blank Line Remover
#1
Quick little code for Windows .bas code that got double spaced at a forum:
Code: (Select All)
_Title "Blank Line Remover" ' b+ 2023-02-04

FixMe$ = _OpenFileDialog$("Select .bas file to remove blank lines from", _CWD$, "*.bas", "Basic files")
t$ = Mid$(FixMe$, 1, _InStrRev(FixMe$, "\")) + "temp.bas"
cancel& = _MessageBox("Check Names", "Fix file: " + FixMe$ + Chr$(10) + "Temp: " + t$, "okcancel", "question")
If cancel& = 1 Then
    Open FixMe$ For Input As #1
    Open t$ For Output As #2
    While EOF(1) = 0
        Line Input #1, fline$
        If _Trim$(fline$) <> "" Then Print #2, fline$
    Wend
    Close
    Kill FixMe$
    Name t$ As FixMe$
    Print "File converted."
End If
b = b + ...
Reply




Users browsing this thread: 1 Guest(s)