On 9/17/2009 11:42 AM, MCMLXXIX wrote:ã> calling File.iniGetValue("section",null); sets the file position to theã> character immediately after the NEXT section heading. so with an empty sectionã> at the beginning and end of the file I can get the file position for the startã> of each section of text (and consequently the end of each section byã> readln()-ing up until the position is greater than that of the next section andã> dumping the last line)ã> ã> sexy.. unless you know of a better wayããUse XML, I know some won't like it.. but here goes...ã
https://developer.mozilla.org/En/E4X/Processing_XML_with_E4Xããhelp.xmlã <help>ã <section id="yourIdentifier">ã ..content here...ã </sectionName>ãã <section ...>ã ...ã </section>ã ...ã </help>ããread the file in with a...ã var f = new File(...);ã if (!f.open("r", true))ã throw "Unable to open help file '" + filename + "'.";ã var helpXml = new XML(f.readAll().join(""));ããyou now have an E4X based XML object you can read in your information from...ãã var sectionContent = helpXml.section.(@id == "yourIdentifier");ããThis will give you the content within a given section... :)ããNote: you'll want to escape your < and > characters to < and > .. the ãCDATA blocks can sometimes wonk up e4x parsing ymmv.ããAlso, this will require synchronet 3.15 built around January of this year or ãnewer. It works pretty well...ãã=====ããI'm working on using e4x as a templating system for the web side of things... ãit's a work in progress, but seems to be going okay...ãã pagename.sspã create class "Page"ã establish optional "Page.Master" static valueã master.ssp <-- this is based on Page.Masterã create class "Master"ã pagename.ssp.htmlã xml e4x template markup for pageã master.ssp.html <-- only if Page.Master is definedã xml e4x template markup for master page.ããhandler creates a response object...ãLoad pagename.sspãLoad master.sspãcreates new instance of Pageãhandler calls page.preInitãcreates new instance of Masterãinject Page and Masterãhandler calls page.initãhandler calls master.initãLoad pagename.ssp.html as e4x "response.page"ãLoad master.ssp.html as e4x "response.master"ãevaluate response objectãhandler calls page.onLoadãevaluate response objectãhandler calls master.onLoadãevaluate response objectãhandler calls page.preRenderãevaluate response objectãhandler calls master.preRenderãevaluate response objectãhandler calls page.renderãevaluate response objectãhandler calls master.renderãevaluate response objectãtransmit output from the response objectããWhen evaluating the response object.. an end/exit state will jump to the ãoutput... an exception/error thrown will result in an output based on that ãexception.ããWorks better than how I had originally planned on it... still have some kinks ãto work out. :) Finally got some more work done on it over the weekend.ãã-- ãMichael J. Ryan -
http://tracker1.info/ãã... B5: Doesn't anyone listen to one damn word I say?ãã---ã þ Synchronet þ Roughneck BBS -
telnet://roughneckbbs.com - www.roughneckbbs.comã