Last post Sep 05, 2014 03:03 AM by Eileen ni - MSFT
Sep 04, 2014 12:37 AM|nirmal2014|LINK
I have an asp page which contain the following code
I don't understand what does it mean.
Sep 04, 2014 12:42 AM|David Anton|LINK
It's taking the bitwise 'and' of 'id' and 2048 - the result is an integer. It then converts that to a boolean via 'CBool'. This is terrible code - why convert an integer to a boolean? Only the integer '0' will convert to the boolean value 'True' - all
others will convert to 'False'. Totally idiotic code.
It would have been far clearer to code "myvar = (id And 20048) = 0" than this crap.
Sep 05, 2014 03:03 AM|Eileen ni - MSFT|LINK
Thanks for your post.
cbool ( expression and value)
The CBool function converts an expression to type Boolean.The expression must be a numeric value.
please check this:http://www.w3schools.com/vbscript/func_cbool.asp
Hope this can be helpful.