Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do i color code text boxes based on db?
Message
From
13/01/2002 02:29:25
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00594778
Message ID:
00604029
Views:
29
>Dragan,
>
>One last question and then I promise to leave you alone :). In your email below you say the function should return numbers between 0 and 1677215.

decimal: (0 .. 1677215) = hexadecimal: (0x0 .. 0xffffff)

>Well what if I am using a color like RGB(1,128,255) which equals 0x00ff8001. That value is not within the range.

0x00ff8001 = 16744449, and is in the range

>So in this case am I forced to call the RGB function? Saying this.forecolor = FF8001 obviously results in an error.

this.forecolor = 0xFF8001 should work

VFP uses C/C++ style hexadecimal notation, any numeric literal that has 0x as its prefix is interpreted as base 16 instead of base 10.

In C/C++, but not in VFP, any numeric literal that has 0 as its prefix is interpreted as base 8 (octal.) In octal, 010 = 8. Octal was popular on computers with 9 bit bytes because the three octal digits evenly map to 9 bits (binary digits.) Hexadecimal is more popular now because modern computers have 8 bit bytes and 2 hexadecimal digits evenly map to 8 bits.

Hex representation: http://cs.senecac.on.ca/~ward/ops334/ops_datarep.html
Previous
Reply
Map
View

Click here to load this message in the networking platform