# TLO:Ini

## Description

Reads value(s) from an ini file located in a relative or absolute path.

## Forms

* [*string*](/macroquest/data-types-and-top-level-objects/top-level-objects/tlo-ini.md) **Ini\[\***&#x66;ilename\*\*\*,**''section\_**,**\_key\_**,**\_default'**']\*\*
  * The *section*, *key*, and *default* do not need to be given. If *section* or *key* are not given, multiple

    values are read.
  * *Section* and *key* may be set to -1 to skip them and give a new value.
  * If the ini is located in a directory other than the root Macros directory is located, you can use a DOS-style

    filepath (relative or absolute) to locate the ini. If the macro accessing the ini is in the same non-root

    directory, you will still to provide the (relative or absolute) filepath.

## Access to Types

* [*string*](/macroquest/data-types-and-top-level-objects/top-level-objects/tlo-ini.md) **string**

## Examples

If sample.ini contains:

`[KeyOne]`\
`value1=foo`\
`value2=bar`\
`[KeyTwo]`\
`Value3=foobar`

`/echo ${Ini[sample.ini,KeyOne,value1]} foo`\
`/echo ${Ini[sample.ini,KeyOne]} value1|value2||`\
`/echo ${Ini[..\sample.ini]} KeyOne|KeyTwo||`

If sample.ini is in \Macros\iniTest folder:

`/echo ${Ini[sample.ini]} NULL`\
`/echo ${Ini[iniTest\sample.ini]} KeyOne|KeyTwo||`

## See Also

* [Top-Level Objects](/macroquest/data-types-and-top-level-objects/top-level-objects.md)
* [string](/macroquest/data-types-and-top-level-objects/top-level-objects/tlo-ini.md)
* [/ini for writing information to the ini file](/macroquest/commands/slash-commands/ini.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://macroquest.gitbook.io/macroquest/data-types-and-top-level-objects/top-level-objects/tlo-ini.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
