Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Every programming language has its own data type. And a data type basically describes data that we are going to be placing into variables that we create. Now a variable is a placeholder. For example we create a variable called 'x', and we use that to store data. And then whenever we call 'x' or print 'x' or whatever, it prints the data that contained there. Now a data type simply tells the computer what kind of data we are going to be storing in a variable, and what size the variable should be. For example, if we type this command, dim 'x' as int or integer 16 We are saying that we are going to create a variable 'x', and this variable is going to be of the type int16. This tells us that this is going to be integer, which means we are going to store whole numbers. And 16 for Visual Basic says we are going to use 16-bits to store that. Now 16-bits of course is 2-bytes. Because we have 8-bits in a byte. So 2-bytes or 8 bits will store over 65,000 pieces of data, or up to a number 65,000 and some change. So usually what we do is we split this down the middle and this will record say from negative 32,700 and something up through positive 32,700 and something. Now I want you to think a minute, the processor of your computer sits here and I'm going to draw a crude picture, this is your processor, ok. So this is the processor, this is the CPU and this is sitting there and only thing that your computer can speak in is zero's and one's and so here are all these zero's and one's coming by, and these things are being thrown at the processor at a high rate of speed and it's reading these things. Now as they arrive at the processor, it has to know exactly what are these things, and how are they being used. This is a very, very simplistic way of helping you understand what a data type is. OK there is a lot more to it than this. But as these zero's and one's get here, the CPU needs to know is this a number? Should this be a decimal? A point type number? Should this be character data, because it's got to take this data and treat it in a certain way. And also in memory, when we "dim x as int16", we create an area in memory, if you want to think about it in this way. with a certain size and it will hold 16 places or 16 bits of memory in here. So if we try to store something that stores more data than that, we have what's called a data overflow. And we'll get an error back, it says - well you know I can't, I can't store that data there. So that's how a data type works. Now so the data type describes the data and then also it determines the storage, and just a couple of little examples: integer 16 stores 16 bits of data, integer 32 stores 32 bits of data. So we control efficiency in our program and it's use of memory by choosing the correct data types for our data. Now, we basically have two main types of data types that most programmers understand and that is string data or alpha characters, the alphabet, and numeric data. And numeric data can be in the form of an integer, which is a whole number or decimal numbers or floating-point decimal numbers and so forth. And so the way these data types are used, we use them to indicate to the program what kind of data that we are going to store and how much memory to set aside for this data. Now in the up coming videos we are going to talk about some of the data types that are available to you in Visual Basic .NET. Then we are going to talk about some miscellaneous data type issues. There are basically two main types of data types in Visual Basic and I want to explain those and how they are managed by the .NET Framework.
| Course: | Microsoft Visual Basic .NET |
| Author: | Mark Long |
| SKU: | 33433 |
| ISBN: | 1932072349 |
| Release Date: | 2003-05-27 |
| Duration: | 6 hrs / 87 lessons |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |