Return to index

ini functions

map = ini_add_key(ini_map,section_name,key(string),value(any))

top

Add new key-value pair to end of section. Error if key already exists.


map = ini_add_key_with_comment(ini_map,section_name,key(string),value(any),comment(string))

top

Add new key-value pair with inline comment to end of section. Error if key already exists.


map = ini_delete_key(ini_map,section_name,key(string))

top

Delete key from section. Error if key doesn't exist.


map = ini_delete_section(ini_map,section_name)

top

Delete section by name and renumber remaining sections.


array = ini_get_global(ini_map)

top

Get global section entries (before any [section] header).


any = ini_get_key(ini_map,section_name,key(string))

top

Get value of specific key in section. Error if key doesn't exist.


array = ini_get_section(ini_map,section_name(string))

top

Get all entries in section including metadata. Error if section doesn't exist.


bool = ini_has_key(ini_map,section_name,key(string))

top

Check if key exists in section. Returns true if found, false otherwise.


map = ini_insert_section(ini_map,section_name,position)

top

Insert section at position (1-indexed, 0=prepend) and renumber.


array = ini_list_keys(ini_map,section_name(string))

top

Get array of all key names in section. Error if section doesn't exist.


map = ini_meta_update(ini_map)

top

Renumber section orders in map to ensure sequential consistency.


map = ini_new_section(ini_map,section_name)

top

Append new section at end of order and renumber.


map = ini_read(filepath)

top

Read an INI file and return a map of sections. Empty string key is global section.


map = ini_set_global(ini_map,entries([]any))

top

Set global section entries.


map = ini_set_key(ini_map,section_name,key(string),value(any))

top

Update existing key value. Preserves inline comments. Error if key doesn't exist.


map = ini_set_section(ini_map,section_name(string),entries([]any))

top

Replace entire section with new entries array. Error if section doesn't exist.


nil = ini_write(ini_map,filepath)

top

Write an INI map to file. Preserves comments and formatting.