{"id":4314,"date":"2014-01-09T10:16:53","date_gmt":"2014-01-09T02:16:53","guid":{"rendered":"http:\/\/www.vbtutor.net\/?page_id=4314"},"modified":"2018-02-17T15:59:26","modified_gmt":"2018-02-17T07:59:26","slug":"visual-basic-2013-lesson-8-understanding-data","status":"publish","type":"page","link":"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-lesson-8-understanding-data\/","title":{"rendered":"Visual Basic 2013 Lesson 8: Understanding Data"},"content":{"rendered":"<h4 style=\"text-align: center;\"><a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-lesson-7-displaying-images-with-the-picture-box\/\">[Lesson 7]<\/a> &lt;&lt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-tutorial\/\">[Contents]<\/a> &gt;&gt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-lesson-9-variable-and-constants\/\">[Lesson 9]<\/a><\/h4>\n<p>We deal with many kinds of data in our daily life. For example, we need to handle data like names, phone number, addresses, money, date, stock and more\u00a0every day. Similarly, in Visual Basic 2013, we have to deal with all sorts of data In Visual Basic 2013, data can be stored as variables, constants or arrays. The value of a variable always changes, just like the contents of a mailbox or the storage bin. The value of a constant remains the same throughout. An array comprises rows and columns of variables or constant.<br \/>\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"3914691604\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h3>8.1 Visual Basic 2013 Data Types<\/h3>\n<p>Visual Basic 2013 classifies information into two major data types, \u00a0the numeric data type, and the non-numeric data type<\/p>\n<h4>8.1.1 Numeric Data Types<\/h4>\n<p>Numeric data types comprise numbers that can be calculated arithmetically\u00a0using standard operators such as addition, subtraction, multiplication, division and more. Examples of numeric data types are examination marks, height, body weight, the number of customers, stock price, price of goods, bills, bus fares and more. In Visual Basic 2013, numeric data are divided into seven types based on the range of values they can store. Calculations that only involve round figures that do not need high precision can use Integer or Long integer. On the other hand,\u00a0high precision calculation requires the\u00a0use Single and Double precision data types, they are also called floating point numbers. For currency calculation, you use the currency data types. if even more precision is required to perform calculations, you\u00a0can use the decimal data types. These data types are summarized in Table 8.1<\/p>\n<h4 align=\"center\">Table 8.1: Numeric Data Types<\/h4>\n<div style=\"overflow-x:auto;\">\n<table>\n<tbody>\n<tr>\n<th witdh=\"18%\">Type<\/th>\n<th width=\"20%\">Storage<\/th>\n<th width=\"62%\">Range of Values<\/th>\n<\/tr>\n<tr>\n<td>\u00a0Byte<\/td>\n<td>\u00a01 byte<\/td>\n<td>\u00a0 0 to 255<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Integer<\/td>\n<td>\u00a02\u00a0bytes<\/td>\n<td>\u00a0 -32,768 to 32,767<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Long<\/td>\n<td>\u00a04\u00a0bytes<\/td>\n<td>\u00a0-2,147,483,648 to\u00a02,147,483,648<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Single<\/td>\n<td>\u00a04\u00a0bytes<\/td>\n<td>-3.402823E+38 to -1.401298E-45 for negative values<br \/>\n1.401298E-45 to 3.402823E+38 for positive values.<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Double<\/td>\n<td>\u00a08\u00a0bytes<\/td>\n<td>-1.79769313486232e+308 to -4.94065645841247E-324 for negative values<br \/>\n4.94065645841247E-324 to 1.79769313486232e+308 for positive values.<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Currency<\/td>\n<td>\u00a08\u00a0bytes<\/td>\n<td>-922,337,203,685,477.5808 to 922,337,203,685,477.5807<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Decimal<\/td>\n<td>\u00a012\u00a0bytes<\/td>\n<td>+\/- 79,228,162,514,264,337,593,543,950,335 if no decimal is use<br \/>\n+\/- 7.9228162514264337593543950335 (28 decimal places).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>8.1.2 Non-numeric Data Types<\/h4>\n<p>Non-numeric data types are data that cannot be manipulated using standard arithmetic operators. They\u00a0comprise the string data types, the Date data types, the Boolean data types that store only two values (true or false), Object data type and Variant data type.They are summarized in Table 8.2<\/p>\n<h4 align=\"center\">Table 8.2: Non-numeric Data Types<\/h4>\n<div style=\"overflow-x:auto;\">\n<table>\n<tbody>\n<tr>\n<th>Type<\/th>\n<th>Storage<\/th>\n<th>Range<\/th>\n<\/tr>\n<tr>\n<td>String(fixed length)<\/td>\n<td>Length of string<\/td>\n<td>1 to 65,400 characters<\/td>\n<\/tr>\n<tr>\n<td>String(variable length)<\/td>\n<td>Length + 10 bytes<\/td>\n<td>0 to 2 billion characters<\/td>\n<\/tr>\n<tr>\n<td>Date<\/td>\n<td>\u00a08\u00a0bytes<\/td>\n<td>January 1, 100 to December 31, 9999<\/td>\n<\/tr>\n<tr>\n<td>Boolean<\/td>\n<td>\u00a02\u00a0bytes<\/td>\n<td>True or False<\/td>\n<\/tr>\n<tr>\n<td>Object<\/td>\n<td>\u00a04 bytes<\/td>\n<td>Any embedded object<\/td>\n<\/tr>\n<tr>\n<td>Variant(numeric)<\/td>\n<td>\u00a016\u00a0bytes<\/td>\n<td>Any value as large as Double<\/td>\n<\/tr>\n<tr>\n<td>Variant(text)<\/td>\n<td>Length+22 bytes<\/td>\n<td>Same as variable-length string<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>8.1.3 Suffixes for Literals<\/h4>\n<p>Literals are values that you assign to data. In some cases, we need to add a suffix behind a literal so that VB can handle the calculation more accurately. For example, we can use num=1.3089# for a Double type data. The suffixes are summarized in Table 8.3.<\/p>\n<h4 align=\"center\">Table 8.3<\/h4>\n<div style=\"overflow-x:auto;\">\n<table>\n<tbody>\n<tr>\n<th>Suffix<\/th>\n<th>Data Type<\/th>\n<\/tr>\n<tr>\n<td>&amp;<\/td>\n<td>Long<\/td>\n<\/tr>\n<tr>\n<td>!<\/td>\n<td>Single<\/td>\n<\/tr>\n<tr>\n<td>#<\/td>\n<td>Double<\/td>\n<\/tr>\n<tr>\n<td>@<\/td>\n<td>Currency<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In addition, we need to enclose string literals within two quotations and date and time literals within two # sign. Strings can contain any characters, including numbers. The following are few examples:<\/p>\n<pre style=\"font-size: 110%;\">memberName=\"Turban, John.\"\r\nTelNumber=\"1800-900-888-777\"\r\nLastDay=#31-Dec-00#\r\nExpTime=#12:00 am#\r\n<\/pre>\n<p><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block;\" data-ad-format=\"autorelaxed\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"2306771905\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h4 style=\"text-align: center;\"><a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-lesson-7-displaying-images-with-the-picture-box\/\">[Lesson 7]<\/a>\u00a0&lt;&lt;\u00a0<a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-tutorial\/\">[Contents]<\/a>\u00a0&gt;&gt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/vb2013-lesson-9-variable-and-constants\/\">[Lesson 9]<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"<p>[Lesson 7] &lt;&lt; [Contents] &gt;&gt; [Lesson 9] We deal with many kinds of data in our daily life. For example, we need to handle data like names, phone number, addresses, money, date, stock and more\u00a0every day. Similarly, in Visual Basic 2013, we have to deal with all sorts of data In Visual Basic 2013, data &hellip; <a href=\"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-lesson-8-understanding-data\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Visual Basic 2013 Lesson 8: Understanding Data<\/span><\/a><\/p>\n","protected":false},"author":23013,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-4314","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Visual Basic 2013 Lesson 8: Understanding Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB<\/title>\n<meta name=\"description\" content=\"This tutorial lesson explains data types, variables and constant in visual basic 2013\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Visual Basic 2013 Lesson 8: Understanding Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"og:description\" content=\"This tutorial lesson explains data types, variables and constant in visual basic 2013\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html\" \/>\n<meta property=\"og:site_name\" content=\"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Vbtutor\" \/>\n<meta property=\"article:modified_time\" content=\"2018-02-17T07:59:26+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@liewvk\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-lesson-8-understanding-data\/\",\"url\":\"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html\",\"name\":\"Visual Basic 2013 Lesson 8: Understanding Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/#website\"},\"datePublished\":\"2014-01-09T02:16:53+00:00\",\"dateModified\":\"2018-02-17T07:59:26+00:00\",\"description\":\"This tutorial lesson explains data types, variables and constant in visual basic 2013\",\"breadcrumb\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vbtutor.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visual Basic 2013 Lesson 8: Understanding Data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vbtutor.net\/#website\",\"url\":\"https:\/\/www.vbtutor.net\/\",\"name\":\"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"description\":\"Start learning Visual Basic from beginner to advanced. Includes VB.NET, VBA, and classic VB tutorials for students and professionals.\",\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Visual Basic 2013 Lesson 8: Understanding Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"This tutorial lesson explains data types, variables and constant in visual basic 2013","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html","og_locale":"en_US","og_type":"article","og_title":"Visual Basic 2013 Lesson 8: Understanding Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","og_description":"This tutorial lesson explains data types, variables and constant in visual basic 2013","og_url":"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html","og_site_name":"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","article_publisher":"https:\/\/www.facebook.com\/Vbtutor","article_modified_time":"2018-02-17T07:59:26+00:00","twitter_card":"summary_large_image","twitter_site":"@liewvk","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2013-lesson-8-understanding-data\/","url":"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html","name":"Visual Basic 2013 Lesson 8: Understanding Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/#website"},"datePublished":"2014-01-09T02:16:53+00:00","dateModified":"2018-02-17T07:59:26+00:00","description":"This tutorial lesson explains data types, variables and constant in visual basic 2013","breadcrumb":{"@id":"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.vbtutor.net\/vb2013\/vb2013_lesson8.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vbtutor.net\/"},{"@type":"ListItem","position":2,"name":"Visual Basic 2013 Lesson 8: Understanding Data"}]},{"@type":"WebSite","@id":"https:\/\/www.vbtutor.net\/#website","url":"https:\/\/www.vbtutor.net\/","name":"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"Start learning Visual Basic from beginner to advanced. Includes VB.NET, VBA, and classic VB tutorials for students and professionals.","inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/4314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/users\/23013"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/comments?post=4314"}],"version-history":[{"count":68,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/4314\/revisions"}],"predecessor-version":[{"id":12447,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/4314\/revisions\/12447"}],"wp:attachment":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/media?parent=4314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/categories?post=4314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/tags?post=4314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}