Hi Raptor88
thanks to take a look at my code
about why I don't use a global definition of the type of the variables at the begin of the code....
1. the first reason is that has explained with supreme clearness Steve, the reusability of the code if you use the SUBs and Functions. I started this habit in writing code in the time of when I was coding in Qbasic, in which I realized that more times I had had coded for the same functions (mouse implementation by ASM and Call Absolute, ASCII windowing in MSDOS etc). Moreover in QB you can make an your own library that you could compile using a command line option on loading QB, today in QB64 you can use your personal library splitting your code in declaration part (that you $include: at the start of the program) and in code part (that you $include: at the end of the program).
2. the second reason is that also if you use DEFINT or DEFSTR or someother definition, you must DIM SHARED or COMMON variables
DIM SHARED A AS LONG, whites(1 TO 50) AS LONG, Black AS LONG
DIM SHARED r AS INTEGER, g AS INTEGER, b AS INTEGER, counter AS INTEGER
3. the third reason is that I am following some instructions to write clear code to be readable also after much time and avoid bugs. These instructions are born for coding clear C but they works fine also for Basic. The concepts behind are writing names (constants, variables, labels, subs and functions) that tell you what do that code, chunk the work in miniworks to assemble in sequence, initialize variables to default values before to use them and to avoid garbage in RAM, release the resources that are not more used (opened files, images loaded, sound loaded, arrays and variables dynamic).
Thanks to read