|
Post by Psycho on May 11, 2008 18:24:02 GMT -5
Is there a way to print a hard copy of a Run Basic program with single line spacing? I usually open the program with MS Word and print from there, but there is an extra CR between each line which doubles the number of pages I would otherwise be printing. I haven't figured out how to strip away those extra CR's for printing.
Any help would be appreciated.
John aka Psycho
|
|
|
Post by Jerry Muelver on May 11, 2008 20:17:55 GMT -5
I use TextPad for editing text files, and do a search-replace on RB source to change all double-returns into single-returns. You can do that in Word, too. Check Word Help for search-replace parameters. It used to be ^p for carriage-return (paragraph), and you could replace ^p^p with ^p to get what you want.
|
|
|
Post by Psycho on May 11, 2008 20:26:49 GMT -5
That's what I needed to know Thanks, Jerry!
|
|
|
Post by mikeukmid on May 15, 2008 13:34:08 GMT -5
Why not use RunBASIC to do the job? Open the program file, store in a string and print the string to a cleared page. The page is rendered without the blank lines and can be printed from the browser File/Print menu. Here's an example to get you started, if no one finds a problem with it, I will put it on the RB Wiki.Edit: Hmm, IE7 scales down to almost unreadable tiny font size when long lines are present so back to cleaning up and printing with Textpad for now! Mike
|
|
|
Post by mikeukmid on May 17, 2008 9:24:01 GMT -5
OK, I think I have a solution which works ok for me with IE7. Try this RunBASIC program to browse your RB projects and enables hard copy printout of the code with single line spacing, from the browser.
' folderBrowser-fileSelector DefaultDir$="c:\rbp\" 'DefaultDir$="c:\rbp101b1\" 'for beta testers cssid #lbStyle1, "{width:300px;background-color:#FEFECD}"
[start] cls print "RB Folder browser" files #rbdir, DefaultDir$+"*" nFolders=#rbdir rowcount() dim folderList$(nFolders) for x = 1 to nFolders #rbdir nextfile$() if #rbdir isdir() then dir$ = #rbdir name$() if #rbdir hasanswer()then 'print dir$ folderList$(x)=dir$ end if end if next x listbox #lb, folderList$(),10 #lb setid("lbStyle1") print:print link #sel, "[ul]",[select]
wait
[select] folderName$=#lb selection$() files #f,DefaultDir$;folderName$;"\*" nFiles=#f rowcount() dim fileList$(nFiles) for x = 1 to nFiles #f nextfile$() if #f isdir() then zz=0 'do nothing else fil$ = #f name$() if #f hasanswer()then 'print fil$ fileList$(x)=fil$ end if end if next x
cls listbox #lb, fileList$(),10 #lb setid("lbStyle1") print:print link #L1, "[Another]", [start] link #L2, "[Accept selection]", [accept] wait
[accept] fName$=#lb selection$() if fName$<>"" then cls open folderName$+"\"+fName$ for input as #fi pf$=input$(#fi, lof(#fi)) close #fi html "<div style=""width:700px;word-wrap:break-word;font-family:Courier New,Courier,monospace;font-size:10pt"">" html "<pre>" print pf$ html "</pre>" print:print html "</div>" link #L1, "[Another]", [start] end if wait
|
|
|
Post by mackrackit on May 17, 2008 19:21:35 GMT -5
Works great here with IE7. Nice idea.
|
|
|
Post by StefanPendl on May 17, 2008 20:07:20 GMT -5
To simplify the search you could use ProjectsRoot$, which points to the main projects folder, search for sub-folders ending with _project and search for *.bas files in those sub-folders.
|
|
|
Post by StefanPendl on May 17, 2008 20:38:04 GMT -5
Here is the updated version. The word wrap does not work in Firefox.Found a solution to include word wrap for any browser at FIREFOX / IE Word-Wrap, Word-Break, TABLES FIXFirefox will wrap at spaces only.Added a TITLEBAR command to change the caption of the printed page to the displayed source code name. ' folderBrowser-fileSelector ' ' includes word wrap hint from ' petesbloggerama.blogspot.com/2007/02/firefox-ie-word-wrap-word-break-tables.html cssid #lbStyle1, "{width:300px;background-color:#FEFECD}" [start] cls print "RB Folder browser" files #rbdir, ProjectsRoot$;"\*_project" nFolders=#rbdir rowcount() dim folderList$(nFolders) for x = 1 to nFolders #rbdir nextfile$() if #rbdir isdir() then dir$ = #rbdir name$() if #rbdir hasanswer()then 'print dir$ folderList$(x)=dir$ end if end if next x listbox #lb, folderList$(),10 #lb setid("lbStyle1") print:print link #sel, "
|
|
|
Post by StefanPendl on May 17, 2008 23:19:40 GMT -5
One may specify a real length unit for the width, so instead of width:700px use width:8in, which will define the area as 8 Inch wide instead of 700 pixels.
An enhancement to the code could be to display for a selected paper size.
|
|
|
Post by mikeukmid on May 19, 2008 5:32:08 GMT -5
Thanks Stefan, I included some of your suggestions and its now on the RB wiki as an open source project.
Mike
|
|
|
Post by Psycho on May 19, 2008 6:52:45 GMT -5
Wow! This took off in a great direction Mike, I'm looking forward to trying your code out from the wiki. I think I'll have to make some minor modifications as it appears you are using some commands that are in the beta release but not the released version that I am using. Thanks to everyone for their thoughts and contribution. It's fun to see this type of process evolve.
|
|
|
Post by StefanPendl on May 19, 2008 13:12:47 GMT -5
Thanks Stefan, I included some of your suggestions and its now on the RB wiki as an open source project. Thanks for finding some of the suggestions useful.
|
|
|
Post by StefanPendl on May 19, 2008 13:18:11 GMT -5
I think I'll have to make some minor modifications as it appears you are using some commands that are in the beta release but not the released version that I am using. The only thing I can think of is the SETID() command, the rest should be already included in the first release.
|
|
|
Post by Psycho on May 19, 2008 19:46:25 GMT -5
Ah, yes Stefan. A quick remark out and it works beautifully.
Thanks again everyone. This is a great utility.
Psycho
|
|
|
Post by StefanPendl on May 20, 2008 14:49:46 GMT -5
Mike, thanks for the font size selection feature you included
|
|