Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:04 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : RGB(..) does not return correct value

Author Message
Bizzie
Senior Member

Joined: 06/07/2014
Location: Australia
Posts: 192
Posted: 03:30pm 07 Jan 2016
Copy link to clipboard 
Print this post

Hi all,

Has anyone come across this before?

>
> Micromite Plus MMBasic Ver 4.7 Beta 36
Copyright 2011-2015 Geof>
> option list
OPTION BAUDRATE 115200
OPTION LCDPANEL ILI9341, LANDSCAPE, 21, 22, 23
OPTION TOUCH 18, 14
OPTION SDCARD 49
> list
CLS

Cl = RGB(255,255,255)

Print Hex$(Cl),Hex$(RGB(255,255,255))

Line 25,25,100,100,1,RGB(255,255,255)

Line 50,25,100,100,1,Cl
> run
1000000 FFFFFF
[13] Line 50,25,100,100,1,Cl
Error: 16777216 is invalid (valid is 0 to 16777215)
>



Rob White
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 03:40pm 07 Jan 2016
Copy link to clipboard 
Print this post

Cl has to be an integer to fit the resulting number into it.
variables default to floating point unless specified otherwise

CLS
dim Cl as integer
Cl = RGB(255,255,255)

Print Hex$(Cl),Hex$(RGB(255,255,255))

Line 25,25,100,100,1,RGB(255,255,255)

Line 50,25,100,100,1,Cl


Jim
VK7JH
MMedit
 
Bizzie
Senior Member

Joined: 06/07/2014
Location: Australia
Posts: 192
Posted: 03:49pm 07 Jan 2016
Copy link to clipboard 
Print this post

Thanks Jim,

Another case I knew the answer would be simple. I will have to get into the habit of declaring a variables type.
Rob White
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025