August 2010
Intermediate to advanced
288 pages
13h 21m
English
One interesting aspect of the File Access block is that it may not be able to perform the task you’ve given it. For example, the block can’t read from a file that doesn’t exist, and it can’t write to a file if the NXT’s memory is full. The block’s Error data plug (shown in Figure 15-9) allows you to check for these kinds of situations. The data plug reports a logic value, namely, true if there was an error and false if the operation was successful.

Figure 15-9. The File Access block’s Error data plug
Any File Access block can have an error. When designing your program, you need to decide whether you should add code to check for ...