Extra code files

Hi, thanks for the replies. Ok, so in the Arduino IDE, say I create a global variable in my main ino file, say int myVar = 1.

If I now create a new TAB in the IDE, and write a function (not in a class) that references myVar, it works, myVar is in scope. I’m struggling to find a way to do this in the spark IDE, if I create a new file (.h & .cpp) and write a function that tries to use a global var in my main file then the new cpp cant see it.