08-25-2022, 01:37 AM
"_DEFINE" is just less typing. Just saying "_DEFINE A-Z AS LONG" at the top of the program is an assumption, then declare with "DIM" whatever else you need which is string, floating point, UDT or whatever. Of course replace "LONG" with type of your choice.
But remember that if you do "_DEFINE A-Z AS LONG", or something more specific like "_DEFINE I AS LONG", then especially in the last case must make sure all variables starting with "i" are of type LONG. Only using "DIM" or using type sigil with variable name could do anything about it.
There is nothing like "DEFLNG" for 64-bit integers in QB64, must use "_DEFINE" in this case, for example "_DEFINE U AS _UNSIGNED _INTEGER64" to have all variables starting with "u" not need type sigil ~&&.
If it causes too much confusion, then avoid "_DEFINE" or the other older ones. Be glad for "_DEFINE" because other BASIC dialects don't have such a thing.
But remember that if you do "_DEFINE A-Z AS LONG", or something more specific like "_DEFINE I AS LONG", then especially in the last case must make sure all variables starting with "i" are of type LONG. Only using "DIM" or using type sigil with variable name could do anything about it.
There is nothing like "DEFLNG" for 64-bit integers in QB64, must use "_DEFINE" in this case, for example "_DEFINE U AS _UNSIGNED _INTEGER64" to have all variables starting with "u" not need type sigil ~&&.
If it causes too much confusion, then avoid "_DEFINE" or the other older ones. Be glad for "_DEFINE" because other BASIC dialects don't have such a thing.