• helpfile.js

    From MCMLXXIX@VERT/MDJ to Digital Man on Thu Sep 17 13:19:11 2009
    I've had that stupid blank script in CVS for months now, and decided to try toãdo something with it today.ããThe purpose of it will be to make some standardized help files for my scriptsãthat can be broken into sections and browsed by section name.ããI was playing around with something today but it didn't work, so my question toãyou is:ããwhat does File.iniGetValue() or File.iniSetValue() do within the file when it'sãdone performing its operation? does it leave the file position where itãfinished? or does it reset to position 0? or EOF?ããI was hoping to use the ini methods as delimiters for help file sections forãquick and easy navigation within a file by reading or setting a value within aãsection to change file position.... but I don't know if it will work.ããthxããã---ã þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)ã
  • From MCMLXXIX@VERT/MDJ to Digital Man on Thu Sep 17 13:35:49 2009
    Re: helpfile.jsã By: MCMLXXIX to Digital Man on Thu Sep 17 2009 13:19:11ãã > I was hoping to use the ini methods as delimiters for help file sectionsã > for quick and easy navigation within a file by reading or setting a valueã > within a section to change file position.... but I don't know if it willã > work.ããthe only way I can think of right now is to append an "=" to the end of everyãline of text in a section and read everything in as a key, but I'd rather notãhave to.ããã---ã þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)ã
  • From MCMLXXIX@VERT/MDJ to Digital Man on Thu Sep 17 14:42:53 2009
    Re: helpfile.jsã By: MCMLXXIX to Digital Man on Thu Sep 17 2009 13:35:49ãã > > I was hoping to use the ini methods as delimiters for help file sectionsã > > for quick and easy navigation within a file by reading or setting aã > > value within a section to change file position.... but I don't know ifã > > it will work.ã >ã > the only way I can think of right now is to append an "=" to the end ofã > every line of text in a section and read everything in as a key, but I'dã > rather not have to.ã >ããafter bouncing this issue off of myself for a while I got something to work,ãand it seems pretty solid.ãã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ããã---ã þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)ã
  • From Tracker1@VERT/TRN to MCMLXXIX on Sun Sep 20 15:41:22 2009
    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 &lt; and &gt; .. 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ã
  • From MCMLXXIX@VERT/MDJ to Tracker1 on Mon Sep 21 14:00:41 2009
    Re: Re: helpfile.jsã By: Tracker1 to MCMLXXIX on Sun Sep 20 2009 15:41:22ãã > 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... :)ããThanks for the ideas. I honestly had no idea JS had support for XML.ããMy synchronet build is ancient, relative to everything else going on here.ãGuess it's time to update.ããã---ã þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)ã
  • From Tracker1@VERT/TRN to MCMLXXIX on Wed Sep 23 00:52:33 2009
    On 9/21/2009 11:00 AM, MCMLXXIX wrote:ã>> var sectionContent = helpXml.section.(@id == "yourIdentifier");ã>>ã>> This will give you the content within a given section... :)ã> ã> Thanks for the ideas. I honestly had no idea JS had support for XML.ã> ã> My synchronet build is ancient, relative to everything else going on here.ã> Guess it's time to update.ããYeah, E4X is pretty cool, I requested the update the the JS engine early this ãyear for some stuff I've been trying to work on... Honestly been busy and ãlazy. Hoping to get some more time next weekend. Got the flash policy ãservice written and working, also trying to get a few more things in place.ãã-- ãMichael J. Ryan - http://tracker1.info/ãã... FRA #111: Treat people in your debt like family ... exploit them.ãã---ã þ Synchronet þ Roughneck BBS - telnet://roughneckbbs.com - www.roughneckbbs.comã
  • From MCMLXXIX@VERT/MDJ to Tracker1 on Wed Sep 23 16:21:19 2009
    Re: Re: helpfile.jsã By: Tracker1 to MCMLXXIX on Wed Sep 23 2009 00:52:33ãã > Yeah, E4X is pretty cool, I requested the update the the JS engine earlyã > this year for some stuff I've been trying to work on... Honestly been busyã > and lazy. Hoping to get some more time next weekend. Got the flash policyã > service written and working, also trying to get a few more things in place.ã >ããflash policy service, you say??ããcould I acquire a copy of that?ããã---ã þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)ã
  • From Tracker1@VERT/TRN to MCMLXXIX on Thu Sep 24 18:37:29 2009
    On 9/23/2009 1:21 PM, MCMLXXIX wrote:ã>> Yeah, E4X is pretty cool, I requested the update the the JS engine earlyã>> this year for some stuff I've been trying to work on... Honestly been busyã>> and lazy. Hoping to get some more time next weekend. Got the flash policyã>> service written and working, also trying to get a few more things in place.ã>ã> flash policy service, you say??ã> ã> could I acquire a copy of that?ããhttp://bbsing.info/downloads/socket-policy-service.zipããI sent a copy to DM so it could be included with sync...ãã-- ãMichael J. Ryan - http://tracker1.info/ãã... FRA #034: Peace is good for business.ãã---ã þ Synchronet þ Roughneck BBS - telnet://roughneckbbs.com - www.roughneckbbs.comã