Jump to content

Recommended Posts

Posted

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]
Posted

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]
Posted (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 by Zacharot
Posted

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.

:rolleyes:

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...