Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  lineFT - draw a thick line James D Jarvis 0 687 08-22-2023, 12:27 AM
Last Post: James D Jarvis
  Program line counter johannhowitzer 0 497 02-25-2023, 06:54 AM
Last Post: johannhowitzer
  A single line function to modify MOD for better pattern recognition.... Pete 4 1,168 11-29-2022, 12:53 AM
Last Post: Pete
  Triangles with line thickness James D Jarvis 0 694 06-24-2022, 12:22 AM
Last Post: James D Jarvis

Forum Jump:


Users browsing this thread: 1 Guest(s)