Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
DLL Projects:
Browse files Browse the repository at this point in the history
- CONFIG.DLL: Fixed write boolean value logic.
- Updated DLLTEST.PRG.
  • Loading branch information
José Miguel Sánchez Fernández committed May 29, 2020
1 parent ac312f4 commit 03813d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Binary file modified DLL/CONFIG.DLL
Binary file not shown.
4 changes: 1 addition & 3 deletions DLL/CONFIG/CONFIG.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ void writeBool()

retval(ini_puts(section,
key,
value % 2 == 0 ?
"true" :
"false",
value % 2 == 0 ? "false" : "true",
filename));
}

Expand Down
15 changes: 9 additions & 6 deletions PRG/TESTS/DLLTEST.PRG
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,27 @@ begin
// Read values from root:
rrb = config_read_bool("bool_value", true);
rri = config_read_int("integer_value", 32);
config_read_string("string_value", "Test", rrs);
config_read_string("string_value", "Test default in root", rrs);

// Read values from section:
config_set_section("Test_Section");
rsb = config_read_bool("bool_value", true);
rsi = config_read_int("integer_value", 32);
config_read_string("string_value", "Test", rss);
config_read_string("string_value", "Test default in section", rss);

// Write values to root:
config_set_section("");
config_write_bool("bool_value", false);
config_write_int("integer_value", 8);
config_write_string("string_value", "Test");
config_write_string("string_value", "Test in root");

// Write values to section:
config_set_section("Test_Section");
config_write_bool("bool_value", false);
config_write_int("integer_value", 8);
config_write_string("string_value", "Test");
config_write_int("integer_value", 256);
config_write_string("string_value", "Test in section");

// Show readed values in screen:
write_int(0, 320, 0, 2, offset rrb);
write_int(0, 320, 10, 2, offset rri);
write(0, 320, 20, 2, rrs);
Expand Down Expand Up @@ -145,10 +147,11 @@ begin
set_input_binds(_input_down, _s, _down, _joy_down);
set_input_binds(_input_exit, _esc, _space, _joy_button1);

// TODO: Export definitions to INI file:

else

// Import definitions from text file:
// TODO: Import definitions from INI file:

end

Expand Down

0 comments on commit 03813d4

Please sign in to comment.