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.
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.
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... :)
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.
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?
Sysop: | fluid |
---|---|
Location: | wickliffe, ohio |
Users: | 4 |
Nodes: | 10 (0 / 10) |
Uptime: | 140:21:07 |
Calls: | 50 |
Files: | 15,838 |
Messages: | 49,859 |