Skip to content

Commit a541a80

Browse files
committed
minor documentation
Fixes copypaste error in file_put_contents documentation, documents system_is_tablet, system_is_chromebook and DIRECTORY_TEMP.
1 parent d2269e3 commit a541a80

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
This property is true if the application is running on a Google Chromebook.
3+
const bool system_is_chromebook;
4+
*/
5+
6+
// example:
7+
void main() {
8+
if(system_is_chromebook)
9+
alert("example", "This application is running on a chromebook!");
10+
else
11+
alert("example", "This application is not running on a chromebook.");
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
This property is true if the application is running on any device that identifies itself as a tablet.
3+
const bool system_is_tablet;
4+
*/
5+
6+
// example:
7+
void main() {
8+
if(system_is_tablet)
9+
alert("example", "This application is running on a tablet!");
10+
else
11+
alert("example", "This application is not running on a tablet.");
12+
}

doc/src/references/builtin/Filesystem/Functions/file_put_contents.nvgt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// Example:
1313
void main() {
14-
if (!put_file_contents("example.txt", "This is an example"))
14+
if (!file_put_contents("example.txt", "This is an example"))
1515
alert("Example", "Failed to write the file.");
1616
else
1717
alert("Example", "Successfully wrote the example file.");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
Property that returns the system's temporary directory, a place where short-term data can be stored.
3+
const string DIRECTORY_TEMP;
4+
## remarks:
5+
A slash character is already appended to the directory returned by this property.
6+
This function may return different values depending on the operating system the application is being run on.
7+
* On Windows, usually C:\Users\%username%\appdata\local\temp/.
8+
* on macOS and Linux systems, usually /tmp/.
9+
* on Android, the app's cache path.
10+
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.
11+
*/
12+
13+
// example:
14+
void main() {
15+
alert("example", "a temporary file for the game could be stored at " + DIRECTORY_TEMP + "filename.txt");
16+
}

0 commit comments

Comments
 (0)