Post by xxgeek on Apr 3, 2021 19:48:05 GMT
I noticed some members have trouble with the BB code and have way too many empty lines in their code.
This little app will take out the empty lines, and add the code tags.
It doesn't affect the original bas file. It only reads it, then closes it.
It leaves the code in the mainwin to copy and paste here.
[edit] oops lol, can't even post it right myself
Because there are code tags in my bas file, the board uses them when I post this.
Can't get it to post as I want it to read.
'Remove the Empty Lines from a Bas File
message$ = chr$(13);" Press ok and select a bas file with the filedialog that pops up to remove empty lines. This doesn't affect the selected bas file, it just reads it and then closes it. Do an edit select all right click copy , and paste it in the forums when you post"
message$ = GetMessage$(message$)
dim item$(50000)
filedialog "Open \ Select a Just Basic Source File (.bas) ", DefaultDir$; "\*.bas",n$ 'to select a .bas file to open
if n$ = "" then wait
open n$ for input as #1
while eof(#1) = 0
x = x + 1
line input #1, item$(x)
textline$ = item$(x)
if x = 1 then print "
"
if textline$ <> "" then print textline$
wend
print ""
close #1
print "
"wait
function GetMessage$(message$)
WindowWidth = 350 : WindowHeight = 250
UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
UpperLeftY=INT((DisplayHeight-WindowHeight)/2)
BackgroundColor$ = "lightgray" : ForegroundColor$ = "black"
statictext #textmessage.text, "", 0, 0, 350, 350
button #textmessage.button, "OK", [quit], UL, 140, 160, 55, 35
open "Information Message - Tips for User" for window as #textmessage
#textmessage.button, "!setfocus"
print #textmessage, "trapclose [close]"
#textmessage, "font Arial bold 8"
#textmessage.text, message$
#textmessage.button, "!font Arial bold 10"
wait
[close]
close #textmessage : exit function
scan
wait
[quit]
scan
close #textmessage : exit function
end function