Skip to content

endLine()

CreativeRobotics edited this page Mar 4, 2020 · 6 revisions

bool endLine()

Appends a newline to the buffer and processes it. This should be used when reading files to handle the final line of a file if it does not contain an end of line character.

Example:

void readFile(){ //Call update for as long as there are still characters left to read //cmd will return 1 when it handles a command and 0 when it reaches the end of the file while(cmd.update()){delay(1);} //If there is no newline at the end of the file then any command on the last line won't be handled //Add a newline to the buffer and handle any commands found there cmd.endLine(); }

Clone this wiki locally