Return to homepage

DOSATO

Copyright © 2024 Sebastiaan Heins

3.4 Input and output

Functions

void SAY (var val, var other ...)

Prints the given values to the console.
The value is converted to a string before being printed.

void SAYLN (var val, var other ...)

Prints the given values to the console, followed by a newline.
The value is converted to a string before being printed.

string LISTEN (string prompt = ?, char delimiter = ?)

Prints the given prompt (optional) to the console, then waits for the user to input a string.
When the user presses enter, the input is returned as a string.
The program will wait for the user to input a string, so the program will not continue until the user has input a string.

File IO

string READ (string path)

Reads the contents of the file at the given path and returns it as a string.
If the file does not exist, err53:ERROR_FILE_NOT_FOUND is thrown.
If the program does not have permission to read the file, err55:ERROR_PERMISSION_DENIED is thrown.

void WRITE (string path, string content)

Writes the given content to the file at the given path.
If the file does not exist, it is created.
If the program does not have permission to write to the file or create it, err55:ERROR_PERMISSION_DENIED is thrown.

void APPEND (string path, string content)

Appends the given content to the file at the given path.
If the file does not exist, it is created.
If the program does not have permission to write to the file or create it, err55:ERROR_PERMISSION_DENIED is thrown.

void DELETE (string path)

Deletes the file at the given path.
If the file does not exist, err53:ERROR_FILE_NOT_FOUND is thrown.
If the program does not have permission to delete the file, err55:ERROR_PERMISSION_DENIED is thrown.

bool EXISTS (string path)

Returns true if the file at the given path exists, false otherwise.

bool MOVE (string path)

Moves the file at the given path to the trash.
If the file does not exist, err53:ERROR_FILE_NOT_FOUND is thrown.
If the program does not have permission to move the file to the trash, err55:ERROR_PERMISSION_DENIED is thrown.

bool COPY (string path)

Copies the file at the given path to the trash.
If the file does not exist, err53:ERROR_FILE_NOT_FOUND is thrown.
If the program does not have permission to copy the file to the trash, err55:ERROR_PERMISSION_DENIED is thrown.