ini_section_exists

Returns whether or not a section in an open .ini file exists.

Syntax:

ini_section_exists(section);


Argument Description
section The section in the open .ini file to check for.


Returns: Boolean


Description

This function checks to see if a section exists in the currently open ini. This is not a necessary check to prevent errors as, when a section does not exist, reading from a non-existent section will just return a default value, however it can be useful to see if an ini file has saved specific data.


Example:

ini_open("savedata.ini");
if !ini_section_exists("save1")
   {
   global.savegame = '1';
   }
ini_close();

This will set variable global.savegame to '1' if 'save1' is NOT found. With a for loop, this could be used as a basic way of working out how many save games there are for a game (ie: creating a system for multiple simultaneous save games for one game).


Back: Ini Files
Next: ini_key_delete
© Copyright YoYo Games Ltd. 2018 All Rights Reserved