ame1011 Posted June 23, 2007 Posted June 23, 2007 Hey there, currently I am storing Question/Answer pairs in '.ini' files and for the most part this is working out for me. However, problems arise when the questions or answers have line breaks or '=' characters in them. I was wondering if there is any better method of storing these values without the need to install external apps (such as databases). Should there be no alternative, I plan to just replace all illegal characters with a legal one (e.g. '=' would become '|') but I thought I'd just pose this question first. [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Mast3rpyr0 Posted June 23, 2007 Posted June 23, 2007 im not sure but maybe you have to slash it like \= or something. if not just change it to some other character and if you need to in your script add something that will find |'s and make them = signs My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here!
ame1011 Posted June 23, 2007 Author Posted June 23, 2007 yup, like I said that's what I plan to do. Just wondering if theres something out there that will allow me to keep my questions intact. [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Zacharot Posted June 23, 2007 Posted June 23, 2007 (edited) here's my take: to store the Q&A properly, all you'd need is to convert the CR and LF into something else, then make a file with alternating pairs of questions, answers, example: Lightest atom? Hydrogen Which moderator tolerates idiocy the least? Valik see? then you load it into an array with _FileToArray(), or whatever it is, and access the question's by accessing the odd's (count is kept in 0, so first is at 1) and the answer is the next in the array simple enough? StringReplace($line,@CR,"|CR|") works well for me. Edited June 23, 2007 by Zacharot
PsaltyDS Posted June 23, 2007 Posted June 23, 2007 yup, like I said that's what I plan to do. Just wondering if theres something out there that will allow me to keep my questions intact.Check out the SQLite functions in the current version of AutoIt. Make this the project you need to learn how to use an SQL database. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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