Jump to content

Wtf Is A .ini?


Recommended Posts

  • Developers

ok i still have no clue wut a .ini is i know that a lot of programs have them but i dont kno wut they do or wut they are for some1 plz explain this to me

http://en.wikipedia.org/wiki/INI_file

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

An initialization file, or INI file, is a configuration file that contains configuration data for Microsoft Windows based applications. Starting with Windows 95, the INI file format was superseded but not entirely replaced by a registry database in Microsoft operating systems.

Although made popular by Windows, INI files can be used on any system thanks to their flexibility. They allow a program to store configuration data, which can then be easily parsed and changed.

File Format

A typical INI file might look like this:

[section1]

; some comment on section1
var1 = foo
var2 = doodle

[section2]

; another comment
var1 = baz
var2 = shoodle

Format

This describes the elements of the INI file format:

Sections: Sections start with '[' and end with ']' as in [section1] and [section2] above.

Parameters: The "var1 = foo" above is an example of a parameter (also known as an item). Parameters begin with a key ('var1'), equals sign ('='), and a value ('foo').

Comments: All the lines starting with a ';' are assumed to be comments, and are ignored.

Differences

The format of INI files is not well defined. Many programs interpret their structure differently than the basic structure that was defined in the above example. The following is a basic list of some of the differences:

Comments: Programs like Samba accept either ';' or '#' as comments. Comments can be added after parameters with several formats.

Backslashes: Adding a backslash '\' allows you to continue the value from one line to another. Some formats also allow various escapes with a '\', such as '\n' for newline.

Duplicate parameters: Most of the time, you can't have two parameters with the same name in one section. Therefore we can say that parameters are local to the section. Although this behavior can vary between implementations, it is advisable to stick with this rule.

Duplicate sections: If you have more than one section with the same name then the last section overrides the previous one. (Some implementations will merge them if they have different keys.)

Some implementations allow ":" in place of "=".

#)
Link to comment
Share on other sites

  • Developers

hmm didnt think of wikipedia. thanx guys. ok now how do i use a INI file??

check the helpfile for Ini????() function for more info...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

There are heaps of information in the help file

Try looking in the index for these:

IniRead()

IniWrite()

IniReadSection()

IniReadSectionNames()

...

The list goes on. The documentation is pretty complete. It should get you what you need. If not, there is always to forum. Just remember to post your code.

Hope you found what you were lookin for,

Sparkes.

---Sparkes.

Link to comment
Share on other sites

ok i looked at the help file but now i dont know wut they mean by "key" in the paramiters (i think they're called)

EDIT: i would also like to know if it is possible to have a While WEnd loop in a While WEnd loop such as when u are using the Loop thing for you GUI

Edited by Zmaster

A great place to start Autoit 1-2-3

Link to comment
Share on other sites

ok well now i finially get wut a .ini is and wut a key is so im done about that. but now i need to know if there is a way to make it so that the program wont run unless a key file is in the folder kind of like with d2 needing the cdkey.mpq thing

A great place to start Autoit 1-2-3

Link to comment
Share on other sites

ok but what i need to know is: is there a way to make it so that ppl cant see the file??

:) I wonder if Valik is reading this thread.

Anyway, you can't really "hide" the file unless you make its data hard to understand or encrypted. Well, you could FileSetAttrib("theFile.ini", "+H")

One reason to use an ini file is so that it could be manually edited if need be.....

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

ok but what i need to know is: is there a way to make it so that ppl cant see the file??

Stab them in their eyes?

:) I wonder if Valik is reading this thread.

Unfortunately.

Zmaster, if you're not able to figure out an INI file, please turn the computer off now and go find something else to do with your life. An INI file is about the most simple storage mechanism in use on computers today. Arguably, it's easier than a flat-text file since most of the parsing is done for you. If you can't figure an INI file out just by looking at it, you definitely do not need to be using a scripting language. It's virtually impossible (as demonstrated) to explain an INI file because they are so simple.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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