How do I write 1 empty row between all the sections in my config.ini file?

jobjorgos

Member
As you can see in the config.ini file below, all sections gets writted without free space (1 empty row) between the sections. Should not be there one empty row between the sections as default? and if its not default, is there a way to write an empty row after every section manully? Having all the sections so stacked up it a bit messy.

GML in-game:
GML:
ini_open("config.ini"); 
    //General Settings:
    ini_write_string("General Settings:", "set_fullscreen", 1 );
    ini_write_string("General Settings:", "set_window_size", 0 );
    //Menu Controls:
    ini_write_string("Menu Controls:", "set_menu_open", 0 );
    ini_write_string("Menu Controls:", "set_menu_navigation", 0 );
    ini_write_string("Menu Controls:", "set_menu_scrolling", 0 );
    ini_write_string("Menu Controls:", "set_menu_select", 0 );
    ini_write_string("Menu Controls:", "set_menu_return", 0 );
    //Character Controls:
    ini_write_string("Character Controls:", "set_character_movement", 0 );
    ini_write_string("Character Controls:", "set_character_jump", 0 );
    ini_write_string("Character Controls:", "set_character_action", 0 );
    ini_write_string("Character Controls:", "set_character_dash", 0 );
    ini_write_string("Character Controls:", "set_character_sneak", 0 );
    //Controller:
    ini_write_string("Controller:", "set_joystick_vibration", 1 );
    ini_write_string("Controller:", "set_joystick", 1 );
ini_close();

config.ini file:
[General Settings:]
set_fullscreen="1"
set_window_size="0"
[Menu Controls:]
set_menu_open="0"
set_menu_navigation="0"
set_menu_scrolling="0"
set_menu_select="0"
set_menu_return="0"
[Character Controls:]
set_character_movement="0"
set_character_jump="0"
set_character_action="0"
set_character_dash="0"
set_character_sneak="0"
[Controller:]
set_joystick_vibration="1"
set_joystick="1"


but I want the text in the config.ini file with space between the sections like this:

1604564583016.png
 
Last edited:

obscene

Member
You can't do it, unless you wanted to use the file functions instead of the ini functions and then you could make your own custom format.
 
Top