diff --git a/src/io/files.js b/src/io/files.js index b0b6992107..36fdb4f937 100644 --- a/src/io/files.js +++ b/src/io/files.js @@ -1194,9 +1194,19 @@ p5.PrintWriter = function(filename, extension) { this.content += data + '\n'; }; /** - * Flushes the PrintWriter object + * Clears the data already written to the PrintWriter object * @method flush * @example + *
+ * // create writer object
+ * var writer = createWriter('newFile.txt');
+ * writer.write(['Flush me']);
+ * // flush writer object here
+ * writer.flush();
+ * // close writer
+ * writer.close();
+ *