-
Notifications
You must be signed in to change notification settings - Fork 1
FileCSV
Jump To | Go Back |
Arguments | Methods | Variables |
---|
Implements: File
Used for creating, reading and saving to CSV files. Files are written on a per-column basis, and you must use writeln() to advance to a new row. Reading is also on a per-column basis, and you can check if you have reached the end of the row by calling eol().
// writing
var _csv = new FileCSV( "my.csv", true, true );
_csv.write( "Sword", 10, 10 );
_csv.writeln( "Armor", 20, 30 );
_csv.close();
// reading
var _csv = new FileCSV( "my.csv", true, false );
show_debug_message( _csv.read() );
// Sword
_csv.readln();
// Armor
show_debug_message( _csv.red() );
Name | Type | Purpose |
---|---|---|
filename | string |
the name of the file to open |
read_only? | bool |
optional: whether this file should allow writing to. Default: true |
new? | bool |
optional: whether this file should be blank. Default: false |
Jump To | top |
read | readln | write | writeln | eol | save |
---|
Returns: real (0.00
), string ("string"
), or undefined
Name | Type | Purpose |
---|---|---|
None |
Reads the next value in the file, if it exists, otherwise returns undefined
.
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Advances the read position to the next line
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
values... | mixed |
The values to write to the file |
Writes value
to the end of the file
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Starts a new line in the file.
Returns: boolean (true
or false
)
Name | Type | Purpose |
---|---|---|
None |
Returns true
if the end of the current line has been reached
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
append | bool |
Whether to append or rewrite the file. |
Saves the file to disk. If append is true
, entries will be appended after the last position the file was written from.
Jump To | top |
---|
- writeIndex - The point at which the file is currently being written to.
- readIndex - The index at which the file is currently being read from.
Devon Mullane 2020