# The QB Times

## Hex Tutorial

Warning: This is meant for advanced QB users or advanced C/C++ users wanting to expand their knowledge and make their own libraries. QB beginners beware; this would be a frighting scare!
Level One: One and only
People how worked with HEX numbers before don't have to read this. Basically as 19day says, run away run away! =) Actually you might find this a bit or two interesting (just keep it under 32-bit please =)

```	Base 1:		Base 2:		Base 8:		Base 10:
0		01		01234567	0123456789
```
OK there you have is some different numbering systems. As you can see Base 1, has only one possibility, it is useless and wont be used. Base 2 has 2, from where you get 'bi', therefor getting the word binary. Base 8 has 8,from where you get 'oct', therefor giving you octal. And obviously comes good old base 10 (the one you should use in your head.) from where you get 'dec', therefor giving you decimal.

Now you might already know all that, but why I'm here is to show you how to count in HEXADECIMAL. It's a Base 16 numbering system.

```        Base 16:
0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
----------------------------------------------
0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
```
There you have it, now you know what all those As Bs and Cs are! You might be asking how to count double hexadigits. Well it's simple, let's take 11 as an example.
```(First digit*16)+(second digit)
```
Which gives us 17. Simple? Sure is, a similar concept applies to quad hexadigits.
```(First digit*4096)+(Second digit*256)+(Third digit*16)+Fourth digit
```
Or you could just use calculator to give you the answer, but I'm sure it's too hard to press Start, Programs, Accessories, Calculator ... no no no ... What's the world coming to??? So back to the real world lets take 2222 as an example, you get 8738! Simple right? Try making your own functions if you want, although it will be useless, there's always HEX\$. Now that over, you could go back to whatever you were reading and finish this tutorial! =)
The author can be contacted at: abionnnn@geocities.com