Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
blue circle isn't drawing and print isn't working?
#6
(09-20-2024, 11:19 PM)madscijr Wrote:
(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.  Tongue

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.
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)
Function MyFunction~& ( <params here/> )
    MyFunction~& = <some value/>
End Function
that you don't need the type suffix when you call it, so that calling 

Code: (Select All)
MyFunction~&(a, b, c)
gets the same value as 

Code: (Select All)
MyFunction(a, b, c)
Whether that's true, I have no idea!
The same for CONSTants

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.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
RE: blue circle isn't drawing and print isn't working? - by TerryRitchie - 09-21-2024, 12:25 AM



Users browsing this thread: 5 Guest(s)