Skip to content

Commit

Permalink
minor documentation
Browse files Browse the repository at this point in the history
Fixes copypaste error in file_put_contents documentation, documents system_is_tablet, system_is_chromebook and DIRECTORY_TEMP.
  • Loading branch information
samtupy committed Oct 19, 2024
1 parent d2269e3 commit a541a80
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
This property is true if the application is running on a Google Chromebook.
const bool system_is_chromebook;
*/

// example:
void main() {
if(system_is_chromebook)
alert("example", "This application is running on a chromebook!");
else
alert("example", "This application is not running on a chromebook.");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
This property is true if the application is running on any device that identifies itself as a tablet.
const bool system_is_tablet;
*/

// example:
void main() {
if(system_is_tablet)
alert("example", "This application is running on a tablet!");
else
alert("example", "This application is not running on a tablet.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// Example:
void main() {
if (!put_file_contents("example.txt", "This is an example"))
if (!file_put_contents("example.txt", "This is an example"))
alert("Example", "Failed to write the file.");
else
alert("Example", "Successfully wrote the example file.");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
Property that returns the system's temporary directory, a place where short-term data can be stored.
const string DIRECTORY_TEMP;
## remarks:
A slash character is already appended to the directory returned by this property.
This function may return different values depending on the operating system the application is being run on.
* On Windows, usually C:\Users\%username%\appdata\local\temp/.
* on macOS and Linux systems, usually /tmp/.
* on Android, the app's cache path.
In any case the directory returned should be writable, though you should expect things you store there to be deleted by external factors at any time.
*/

// example:
void main() {
alert("example", "a temporary file for the game could be stored at " + DIRECTORY_TEMP + "filename.txt");
}

0 comments on commit a541a80

Please sign in to comment.