• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Chr$(60 And &HFF)

petejk

Senior member

I dont understand what the "And" operator? does...

What is &HFF?
What do you think is its relevance as a parameter of Chr()




Thanks
 
&H prefix means the value is in hexadecimal. Hence the 255 value (15*16 + 15)
AND is boolean 'and' operator, if you and anything with &HFF, you get the lower 8 bits.
If you think VB is crap because of this, youshould see C.
 
Then this limits the variable to the range 0-255, the valid numbers for chr$.

var foo = 257

not valid for chr$ !

var bar = foo And &HFF

now bar = 1, a safe value.
 
Back
Top