Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using CONST & _RGB used together seem to error...
#11
It's a feature IF it is documented, notifies the user, and is clear in its explanation. It's a bug if the user reads the manual, uses it as it is written, and then receives an outcome that differs from the promised behavior. This is a bug until documented properly.
The noticing will continue
Reply
#12
It *is* the imagehandle, in all cases except CONST.

Remember, we have two different work flows here. 

CONST is done in the precompiler process.  It works *BEFORE* compile time and before runtime.  So you can't use any runtime values with it.
 
Image handles are usually gotten with _LOADIMAGE or _NEWIMAGE or _COPYIMAGE.  Those are all done at run-time, and not at compile time.

Ergo, CONST can *NOT* use image handles.  You have to specify a SCREEN HANDLE directly for it with _RGB.

But at runtime, it just makes more sense to use _RGB with image handles.  You point it to the handle you want and that's it.  No need to remember the screen mode or any such thing.  Handle alone is good enough, which makes 0 especially useful as image handle 0 can be a SCREEN 0 screen, or a 256 color screen, or a 32-bit screen.   

0 as an image handle is *the current screen*.

0 as a SCREEN MODE is... *a text screen 0*.

Those 0's aren't the same, and the behavior shifts with CONST to mimic that change in behavior with regards to _RGB.

So with _RGB, the extra parameter is:
With CONST, it's the SCREEN MODE.
Any other time (at run time), it's the IMAGE HANDLE.

0 for one is not the same 0 as for the other, and the command relies upon that distinction.
Reply
#13
Well thanks for the explanation.  That's something I didn't know with CONST.

Appreciate all the replies.

- Dav

Find my programs here in Dav's QB64 Corner
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac debugger not connecting, a user error! BlameTroi 0 98 02-07-2026, 06:18 PM
Last Post: BlameTroi
  ERROR MESSAGES COLORS ? aurel 5 376 01-02-2026, 11:26 AM
Last Post: aurel
  error doing image collision detection with _MemGet madscijr 55 4,650 10-01-2025, 03:25 PM
Last Post: bplus
  Using CONST Dimster 15 1,297 08-12-2025, 07:27 PM
Last Post: Kernelpanic
  error on function returning _mem Herve 5 676 07-05-2025, 08:06 PM
Last Post: hsiangch_ong

Forum Jump:


Users browsing this thread: 1 Guest(s)