Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Novice question but... 1

Status
Not open for further replies.

nicsin

Programmer
Joined
Jul 31, 2003
Messages
743
Location
GB
I have been working on VB and I have been recently assigned to make some changes to a delphi module since they are "similar" according to my boss. I was doing just fine until I met this line of code:

settings := settings Or $20;

where settings is an integer. Can you please tell me what $20 stands for?

ps: settings is then saved in registry.

Thanx
 
The $ signals a hexadecimal number. So $20 is 32 decimal. It is also 00100000 in binary which is likely to be more relevant in your example.

The actual statement

settings := settings OR $20;

sets that bit to a one and leaves all the other bits in the variable 'settings' unchanged.

Andrew
Hampshire, UK
 
excellent! Thnx man
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top