Keep track of code/snippets

It would be interesting to see what happens if you put

#include "myFile.txt"

in your program. (Obviously use the correct name for your file)

As a separate point, if you are putting lots of different functions into a .ino file (or a .txt file) it would be wise to use function names and variable names in them that are unlikely to arise in other code or libraries. For example I have a piece of code that creates a "Simple Software Serial" implementation and all the function and variable names start with sss.

...R

kenwood120s:
Rather than the IDE throwing an error, it actually said the file had been added, although it hadn't .

When you do that with a file that doesn't have a recognized code extension it is added to the data subfolder of your sketch folder. That allows you to easily add documentation or other support files to the sketch. I don't know why the folder is named "data", that doesn't seem ideal.

pert:
When you do that with a file that doesn't have a recognized code extension it is added to the data subfolder of your sketch folder.

Ah ok, thanks- I tried that and it is indeed the case. It's a pity the onscreen message is the same as the one for when it creates a tab, but that's no biggy.