1. Back to Bitmaps

WS_EX_CLIENTEDGE,  --style Ex
OR({WS_OVERLAPPED,WS_SYSMENU}),    --style

WS_SYSMENU=#80000
WS_OVERLAPPED=#0

Since #80000 ORed with #0 = #80000 

Why not just put 
WS_EX_CLIENTEDGE,  --style Ex
WS_SYSMENU,    --style 

Why is the OR needed at all?


Don Cole

new topic     » topic index » view message » categorize

2. Re: Back to Bitmaps

don cole wrote:
> 
> WS_EX_CLIENTEDGE,  --style Ex
> OR({WS_OVERLAPPED,WS_SYSMENU}),    --style
> 
> WS_SYSMENU=#80000
> WS_OVERLAPPED=#0
> 
> Since #80000 ORed with #0 = #80000 
> 
> Why not just put 
> WS_EX_CLIENTEDGE,  --style Ex
> WS_SYSMENU,    --style 
> 
> Why is the OR needed at all?
> 
> 
> Don Cole

Hi Don,

Yes, that would work too smile

Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

new topic     » goto parent     » topic index » view message » categorize

3. Re: Back to Bitmaps

don cole wrote:
> 
> WS_EX_CLIENTEDGE,  --style Ex
> OR({WS_OVERLAPPED,WS_SYSMENU}),    --style
> 
> WS_SYSMENU=#80000
> WS_OVERLAPPED=#0
> 
> Since #80000 ORed with #0 = #80000 
> 
> Why not just put 
> WS_EX_CLIENTEDGE,  --style Ex
> WS_SYSMENU,    --style 
> 
> Why is the OR needed at all?
> 
> 
> Don Cole

The names are added for clarity. The programmer doesn't necessarily know that
WS_OVERLAPPED = 0. Plus when reading the source code someone can see all of the
options that the original programmer is intending, whether they are included in
some other option or not.

If you know what you are doing, you could just put in the hex value you want to
use. But you use the names so someone else reading your program can figure out
what you are doing.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu