Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in RGB() function
Message
From
26/06/2015 01:04:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Bug in RGB() function
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01621469
Message ID:
01621469
Views:
106
Either I am missing something or there is a significant bug in the RGB function.

The value of RGB((204,198,149) is returned as 9815756. In hex this is #95C6CC.

That is completely wrong. The value of RGB(204,198,149) is 13420181. In hex that is #CCC695.

I finally figured out the problem: any time the first number was > 99, the RGB() function is returning the number of the RGB in _opposite_ order! IOW the value of RGB(204,198,149) should be 13420181, yet VFP returns 9815756. However doing the RGB backwards, as in RGB(149,198,204) results in the correct decimal for the original order: 13420181.

VFP is reversing the parameters, seemingly randomly, but I ran that RGB on 3 different PC's and it always came up the same wrong answer.

Anybody know anything about this?

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform