I know the col and Fla should be declared before void loop.. but my main point is, do I need to assign another variable or just use same variable as it is? Assuming the variables are all local variables.Or it should be another way around?..
You are not putting a void anywhere. You are defining a function that does not return any data, hence it is void. If you were defining a function that returned an int would you refer to it as an int ?
@SteveMann there is one crucial thing missing from your explanation and that is how you name the files held by the tabs. The file extension is important. I will let you explain
I don't know if "less restrictive" is the right term. It does give you the convenience of automatic function prototype generation --- that feature usually works correctly.
However, it smashes all the .ino files into a single translation unit before handing it off to the compiler. It may be important to know this and the order in which it happens (based on file name after the main .ino).
So, while adequate for newbies, the above does not provide truly modular code that is maintainable and reusable. It is also not suitable for large projects. Also, I prefer to supply my own function prototypes and thus prefer the .h / .cpp file method …. see my Reply #5 Here.
Using .ino as the file extension for the tab files is correct. It causes the pre-processor to join all of the .ino files. including the main one, into one file before compiling the program so local and global variable behave as though they were declared in one .ino file but the joining together of the files does not change the order in which functions and variables are declared
However, you say that you are calling a function in another tab using
anotherfunction(char col= 'RE', byte Fla=255);
Is that how you would call the function if it were in the same file ?
Yes I know. That's why I wrote 'usually'. If someone doesn't know about functions at all, I don't think he knows about default values. Defining default values isn't used often in standard functions - opposite e.g. in classes ( methods and especially constructors ). But of course you can do.
I think they are specified in the declaration ( function prototype ). The compiler must know about it when the function is called. The definition may be in a separate file. But of course, sometimes declaration and definition ist the same.
The default suffix is ".ino" which the compiler just appends to the main ino file as it finds them. I have experimented with libraries where I create two tabs: "xyz.h" and "xyz.cpp".