blindwig Posted August 2, 2005 Share Posted August 2, 2005 (edited) Interesting concept. Would like to help with it but I have no idea on where to start. Infact, I'm not even sure if I quite understand XML. It's like your own custom HTML tags that are only interpreted by your app right?<{POST_SNAPBACK}>No, other way around. HTML is based on XML.XML just defines the formatting of the tags (for example, all tags should be enclosed in angle brackets, a closing tag has a slash before it's name, etc). HTML defines the content of the tags.XML could look like this:<map> <zip>demoranch.zip</zip> <size>14KB</size> <name>Demolition Ranch</name> <author>Truffle</author> <screenshot>demoranch.jpg</screenshot> <tester>Truffle</tester> <description>Small DM arena map designed for Sanchez/Dynamite matches only</description> </map> <map> next map details go here... </map>The advantage that XML has over INI is that INI has only 2 layers: Headers and Keys. XML is nestable, so you could do this:<map> <zip> <file>demoranch.zip</file> <size>14KB</size> </zip> <name>Demolition Ranch</name> <author>Truffle</author> <screenshot>demoranch.jpg</screenshot> <testers> <tester>Truffle</tester> <tester>Some other Guy</tester> <tester>My next door neighbor</tester> <tester>Etc...</tester> </testers> <description> <line>Small DM arena map</line> <line>designed for Sanchez/Dynamite matches only</line> <line>Works best with version x.xx</line> <line>more info goes here</line> <line>etc...</line> </description> </map> Edited August 2, 2005 by blindwig My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
Truffle Posted August 2, 2005 Author Share Posted August 2, 2005 oh man that's so much easier to read than an INI file Link to comment Share on other sites More sharing options...
blindwig Posted August 3, 2005 Share Posted August 3, 2005 INI is easier to read, but also a simplier format. See my added example in the post above. INI has only 2 levels of complexity, XML can have unlimited numbers, just like you see how HTML has multiple layers of nesting. The good news is that IE (and most other browsers) will show you a nice tree view of an XML file if you drag the file into the browser. That's a lot easier than trying to view them in notepad My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
Truffle Posted August 3, 2005 Author Share Posted August 3, 2005 No, really<map>Â <zip>demoranch.zip</zip>Â <size>14KB</size>Â <name>Demolition Ranch</name>Â <author>Truffle</author>Â <screenshot>demoranch.jpg</screenshot>Â <tester>Truffle</tester>Â <description>Small DM arena map designed for Sanchez/Dynamite matches only</description></map><map>Â next map details go here...</map>i think that's easy to read than the INI file that I'm using. Of course that could be because Ive been coding HTML in notepad for six years now. (I of course use editors now but thats another topic)So you would need to tell it to search for < and anything in between the < and > is an opening tag. And do the steps needed until it reaches </What is needed there? A for loop, looping through the entire file using regular expressions to test each line.....Or is that ineffective? (too slow?) Link to comment Share on other sites More sharing options...
GaryFrost Posted August 3, 2005 Share Posted August 3, 2005 (edited) read the line, then stringinstr and stringmid if the tags are always in the same place, could also use stringtrimleft and stringtrimright Edited August 3, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
blindwig Posted August 3, 2005 Share Posted August 3, 2005 Writing your own XML library would be quite a feat (to make it 100% XML standard compatable anyway).Watch DaleHohm's XML thread to see if anyone responds to it.In the mean time, you might want to check out the command-line tool XML Starlet if you want to go the XML route. For now, I'd recommend that you just use CSV - it seems best suited to your task. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
Truffle Posted August 3, 2005 Author Share Posted August 3, 2005 (edited) Okay seems to be working good so far guys thanks for the help....Instead of using Commas to separate values I used the "|". This way i can keep all my commas I'm currently using I wrote a PHP script to convert the INI file to new format (|SV hehe).... saved tons of time. Got another question though (a gui question) this is also a Win98 bugThis is normal appearance in Windows XPhttp://www.olhideout.net/gsxp.jpgBut in 98 the logo on the top right loses a lot of qualityhttp://www.olhideout.net/gs98.jpgThis also happens to any image that i put on a window and the screenshots which are showin in a child window also lose a lot of quality as seen herehttp://www.olhideout.net/gs982.jpgAny idea on why this is doing that? Edited August 3, 2005 by Truffle Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 3, 2005 Share Posted August 3, 2005 Okay seems to be working good so far guys thanks for the help....Instead of using Commas to separate values I used the "|". This way i can keep all my commas I'm currently using I wrote a PHP script to convert the INI file to new format (|SV hehe).... saved tons of time. Got another question though (a gui question) this is also a Win98 bugThis is normal appearance in Windows XPhttp://www.olhideout.net/gsxp.jpgBut in 98 the logo on the top right loses a lot of qualityhttp://www.olhideout.net/gs98.jpgThis also happens to any image that i put on a window and the screenshots which are showin in a child window also lose a lot of quality as seen herehttp://www.olhideout.net/gs982.jpgAny idea on why this is doing that?<{POST_SNAPBACK}>I dont know about the Win98 question, but the second one it seems to me the aspect ratio isnt kept so the quality gets lower. Just my thoughts. Nothing to confirm. Maybe if you use IrfanView to resize images it may be better as by default they keep the proper aspect ratio.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Truffle Posted August 3, 2005 Author Share Posted August 3, 2005 I dont know about the Win98 question, but the second one it seems to me the aspect ratio isnt kept so the quality gets lower. Just my thoughts. Nothing to confirm. Maybe if you use IrfanView to resize images it may be better as by default they keep the proper aspect ratio.JS<{POST_SNAPBACK}>yep for some reason Windows 98 doesnt like it when you put in different dimensions in your GUI than the actual pic holds.My logo on the top right is also used as a splash screen that shows up while the list is being generated. So I created a JPG that is smaller to fit in the area.Then I had 225 screenshots that are all taken at 512x384 but in the GUI are resized at 400x300.... With Infranview, as you suggested, I resized them all and this fixed the problemThanks all for your help. Link to comment Share on other sites More sharing options...
blindwig Posted August 3, 2005 Share Posted August 3, 2005 I'm guessing that when you have a control that is a different size than the image, the image is stretched (or shrunk) to match the control's dimensions. The difference in quality is most likely related to the resizing/smoothing routines of the particular OS. The real solution is just to make your controls the right size. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now