09-21-2024, 02:23 AM
(09-21-2024, 12:25 AM)TerryRitchie Wrote:(09-20-2024, 11:19 PM)madscijr Wrote:The same for CONSTants(09-20-2024, 10:51 PM)SMcNeill Wrote: This one is simple. You're using two different variables of the same name and different types.Actually, I think I recall where the delusion came from... at some point someone said that if you declare a FUNCTION with a type, ie
Code: (Select All)Dim Shared cBlue As _Unsigned Long
In your program, you're using the variable named cBlue... But you DIM SHARED cBlue~&.... those aren't the same variables.
cBlue defaults to a single. cBlue~& is an unsigned long.
singles don't carry blue transparency values, so they get rounded to 0.
that you don't need the type suffix when you call it, so that callingCode: (Select All)Function MyFunction~& ( <params here/> )
MyFunction~& = <some value/>
End Function
gets the same value asCode: (Select All)MyFunction~&(a, b, c)
Whether that's true, I have no idea!Code: (Select All)MyFunction(a, b, c)
CONST BRIGHTRED~& = _RGB32(255, 0, 0)
.. a few moments later ...
CIRCLE(100, 100), 100, BRIGHTRED
The _UNSIGNED LONG type identifier ( ~& ) is not needed at the end of a constant.
Thank you! That is exactly it.
So the suffix isn't needed for functions and constants but it is for variables.