sys_trial(STRING* section, STRING* name, var days)

Returns the number of days left on a demo version of the application. This instruction can be used to create demo applications that expire after some time, and can be unlocked by the user with a key or password.

Parameters:

section Name of the registry section for storing the trial information (e.g. "Software\\myGame"), STRING* or char*.
name Name of the registry key for storing the trial information, STRING* or char*.
days Number of days for the trial period.

Returns:

Trial days remaining, or < 0 when the trial period is expired or an attempt was made to hack the registry.

Speed:

Slow

Remarks:

Edition:

 P   LC 

Example:

function main()
{ ...
wait(1);
game_load("ini",0); // load user settings if (!game_is_unlocked()) // call provider algorithm for checking the key or password
if (0 > sys_trial("Software\\myCompany\\myApp","install",30)) // 30 days trial period expired? sys_exit("Sorry - trial version expired!"); ... // run game game_save("ini",0,SV_INFO); sys_exit(NULL); }

See also:

sys_exit, sys_getstr, sys_setstr

► latest version online