|
Post by b03a8b on Oct 26, 2018 4:24:07 GMT -5
I want to output lines which can be directly read by an HTML interpreter. Is there a way to output quotes within quotes?
Thanks
|
|
|
Post by metro on Oct 26, 2018 7:59:42 GMT -5
is this what your after
mystring$="Hello World" quote$=chr$(34) print quote$+mystring$+quote$ print quote$;mystring$;quote$
|
|
|
Post by metro on Oct 26, 2018 8:16:06 GMT -5
This maybe of interest. Thanks to Alyce
'This demo will not function without lbbrowse.dll '****************************************************** 'LBBROWSE.DLL is copyright Alyce Watson, 2005. 'LBBROWSE.DLL is freeware. You may use it in any application, 'including commercial products. A credit to the author and a 'link to the website must be included in your program's 'documentation or readme file, and in any source code released 'to the public. 'Alyce Watson 'http://alycesrestaurant.com/ '****************************************************** nomainwin dim info$(10,10) 'make up some data to display in a table dim myData$(20,2) dataField$="One Two Three Four Five Six Seven Eight Nine Ten "+_ "Eleven Twelve Thirteen Fourteen Fifteen * # @ $ Twenty" 'put the data into arrays for n=1 to 20 myData$(n,1)=right$("0"+str$(n),2) myData$(n,2)=word$(dataField$,n) next n sortColumn=2 sort myData$(),1,20,sortColumn fileExists=checkExists("lbbrowse.dll") if fileExists = 0 then notice "Demo requires missing dll";chr$(13);"lbbrowse.DLL can be downloaded from";chr$(13);_ "http://alycesrestaurant.com/";chr$(13);_ "The dll is generously provided as freeware";chr$(13);_ "and is Copyright by Alyce Watson." end end if reportFileName$=DefaultDir$+"\report1.htm" 'make your own logo jpeg image, alternative text is displayed if image 'is not found logoImgFile$="chart.jpg" backGroundFile$="libertyBackground.jpg" columnTitle$(1)="Word #" columnTitle$(2)="Data" tableBorder=1 UpperLeftX=1:UpperLeftY=1 WindowWidth=700:WindowHeight=550 menu #main, "&File","&Internet Options",[internetOptions],"&Print Preview",[printPreview],_ "P&rint",[printHtmlReport],"&Exit",[quit] menu #main, "&Sort","Sort by &Word #",[sortColumn1],"Sort by &Data",[sortColumn2] stylebits #main.rptL, _ES_CENTER or _SS_CENTERIMAGE,0,_WS_EX_CLIENTEDGE,0 statictext #main.rptL, "Report title >", 8, 10, 80, 25 textbox #main.rpt, 90,10,200,25 button #main.rb, "Show report", [showHtmlReport],ul 300,10,90,25 button #main.pnt, "Print report", [printHtmlReport],ul 300,10,90,25 checkbox #main.cbx, "Remove table border", [tableBorder],[tableBorder],400,10,140,25 checkbox #main.cbx2, "Remove background", [tableBgnd],[tableBgnd],550,10,140,25 stylebits #main, 0,_WS_VISIBLE,0,0 open "HTML reports from LibertyBASIC" for window as #main #main, "trapclose quit" #main "resizehandler resizer" hMain=hwnd(#main) #main.pnt, "!hide" #main.cbx, "hide" #main.cbx2, "hide" #main, "font arial 9" 'initial page for browser to display url$=DefaultDir$+"\blank.htm" 'set up embedded browser utilising Alyce's lbbrowse dll open "lbbrowse.dll" for dll as #browse calldll #browse, "CreateBrowser", hMain as ulong, 40 as long, _ 55 as long, 600 as long, 400 as long,_ url$ as ptr, 1 as long, result as ulong
if result<>0 then notice "Unable to load browser control." end end if
'hide browser statusbar calldll #browse, "ShowStatusbar", 0 as long, re as void 'enter default report title in textbox #main.rpt, "'My Report'" #main, "show" wait
sub resizer h$ newW=WindowWidth-80:newH = WindowHeight-75 calldll #browse, "MoveBrowser",40 as long, 55 as long, newW as long,_ newH as long, r as void end sub
[showHtmlReport] gosub [buildHtmlReport] wait
[tableBgnd] tableBg=1-tableBg if tableBg=1 then backGroundFile$="" else backGroundFile$="libertyBackground.jpg" end if gosub [buildHtmlReport] wait
[tableBorder] tableBorder=1-tableBorder gosub [buildHtmlReport] wait
[sortColumn1] sortColumn=1 sort myData$(),1,20,sortColumn gosub [buildHtmlReport] wait
[sortColumn2] sortColumn=2 sort myData$(),1,20,sortColumn gosub [buildHtmlReport] wait
[buildHtmlReport] 'show browser calldll #browse, "ShowBrowser", 1 as long, re as void 'get report title from textbox #main.rpt, "!contents? reportTitle$" 'open file to store report open reportFileName$ for output as #htm 'generate html code for report page formatted as table, two columns per row 'note fixed background graphic over which table scrolls. #htm, "<html><head><title>LibertyBASIC/HTML report generator</title></head>";_ "<body background=";backGroundFile$;" bgproperties=fixed><HR size=6 color=gold>";_ "<font size=5 color=red><I>";reportTitle$;"</I>";_ "<img src=";logoImgFile$;" hspace=200 alt=logo_here>";date$();"</font> (Sorted by: ";_ columnTitle$(sortColumn);")</font><BR><HR color=red><BR>" #htm, "<table border=";tableBorder;" width=100% cellspacing=0 bordercolor=gainsboro>" 'enter column titles #htm, "<tr><td width=20% align=left><font size=4 color=green>";columnTitle$(1);"</font></td>" #htm, "<td width=50% align=left><font size=4 color=green>";columnTitle$(2);"</font></td>" #htm, "<td width=30% align=left><font size=4 color=green> </font></td></tr>" fontColor$="blue" 'font color for first ten items 'enter data from arrays into rows of a table for row=1 to 20 #htm, "<tr><td width=20%><font size=2 color=";fontColor$;">"+myData$(row,1);" </font></td>" #htm, "<td width=50%><font size=2 color=";fontColor$;">"+myData$(row,2);" </font></td>" #htm, "<td width=30%><font size=2 color=";fontColor$;"> </font></td></tr>" if row=10 then fontColor$="purple" 'font color for next ten items next row #htm, "</table><BR><BR>This HTML generated report is produced in an embedded browser "+_ "using lbbrowse.dll, generously gifted to us by Alyce, to whom we are "+_ "eternally indebted! This dll gives us a tool to display and print data "+_ "and documents in tables, frames, full colour, including graphics etc.</body></html>" close #htm 'display the report in the browser
calldll #browse, "Navigate",reportFileName$ as ptr, ret as void #main.rb, "!hide" #main.pnt, "!show" #main.cbx, "show" #main.cbx2, "show" return
[printPreview] calldll #browse, "PrintPreview", re as void wait
[printHtmlReport] calldll #browse, "BrowserPrint", re as void wait
[internetOptions] calldll #browse, "InternetOptions", re as void wait
[quit] call quit "#main"
sub quit hW$ calldll #browse, "DestroyBrowser", re as void close #browse close #hW$ end end sub
function checkExists(f$) files "",f$, info$( checkExists = val(info$(0, 0)) end function
|
|
|
Post by Alyce Watson on Oct 27, 2018 9:48:34 GMT -5
Thanks, metro. The DLL is available at my site, so you may post a link instead of uploading it here on the forum. LB Browse
|
|
|
Post by metro on Oct 27, 2018 14:39:47 GMT -5
OOPS, Sorry Alyce I didn't think that one through
|
|
|
Post by meerkat on Oct 27, 2018 14:51:57 GMT -5
I want to output lines which can be directly read by an HTML interpreter. Is there a way to output quotes within quotes? Thanks You can use the hypertext encoding. For (") quote it's "e. Or you can use the decimal with a &#{decimal number} Or print "&#";asc("!") for ! mark html hypertextdetail hypertext encoding
|
|