![]() |
Forum Index : Microcontroller and PC projects : RGB(..) does not return correct value
Author | Message | ||||
Bizzie Senior Member ![]() Joined: 06/07/2014 Location: AustraliaPosts: 192 |
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: AustraliaPosts: 6283 |
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: AustraliaPosts: 192 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |