Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 4: Data, Operations, and Built-In Functions
Last change: February 13 2016 18:47:36.

Byte,SByte and Char Types

As you can see from the preceding table, Byte and SByte type data use one byte of storage and can handle only a small range of values with a very narrow range and low precision (fewer than three complete digits); Byte data cannot handle negative values, while SByte data can. Their use is rather limited for computational purposes. The Char type has a wider range and higher precision; however, it usually is not used for computational purposes, either. Both the Byte and Char types are typically used to handle string data.
Character strings are coded either in ASCII code or Unicode. The ASCII code uses one byte of data storage to represent a character, while the Unicode uses two bytes. The ASCII code has a limited capability in representing characters only up to 256 different symbols. This range is sufficient to handle languages such as English, but insufficient for many other languages. As a result, the Unicode is used more universally because of its capability of representing up to 65,535 different symbols. As you may have already guessed, the Byte type is suitable for handling the ASCII code data, while the Char type is suitable for the Unicode data.

Last change: February 13 2016 18:47:34.