Sign in to follow this  
Followers 0
iHonda

Wtf Is A .ini?

28 posts in this topic

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


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites



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

:)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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 "=".

#)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Edited by Zmaster

A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

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...

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Did you read the remarks section?

A standard ini file looks like:

[sectionName]

Key=Value

Yes, loops can be nested.

Share this post


Link to post
Share on other sites

i did read the remarks but i dont understand what they mean by value


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

What the hell else would a value mean? It's the VALUE that is set to the key. It is really too simple to explain it any simpler.

Share this post


Link to post
Share on other sites

ok i guess what i really want to know is what does the key and value do??


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

Go find some INI files on your computer and look at them.

Or alternatively, use some common sense. What do you think they would do? Think about it for a sec. You have stuff you want to store. What do you do with it? ........

Share this post


Link to post
Share on other sites

ok so the value is what your going to be saving to the .ini?? or am i wrong??


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

an .ini is the opposite of an .outi (had to say it! :) )

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

If _____________ Then

Exit

EndIf

Figure something out for yourself for a change.

Share this post


Link to post
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??


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

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!

Share this post


Link to post
Share on other sites

the file i want to hide isnt and ini its a file that contains a key that the program reads to be sure that the computer is authorized to use the prog


A great place to start Autoit 1-2-3

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0