{"id":5974,"date":"2015-03-23T15:15:19","date_gmt":"2015-03-23T07:15:19","guid":{"rendered":"http:\/\/www.vbtutor.net\/?page_id=5974"},"modified":"2018-02-24T15:27:05","modified_gmt":"2018-02-24T07:27:05","slug":"visual-basic-2015-lesson-8-dealing-data","status":"publish","type":"page","link":"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-8-dealing-data\/","title":{"rendered":"Visual Basic 2015 Lesson 8: Dealing with Data"},"content":{"rendered":"<h4 style=\"text-align: center;\"><a title=\"visual basic 2015 tutorial lesson 7\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-7-working-picture-box\/\">[Lesson 7]<\/a> &lt;&lt; <a title=\"Visual Basic 2015 tutorial\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-tutorial\/\">[Contents] <\/a>&gt;&gt; <a title=\"visual basic 2015 Lesson 9\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-9-working-variable-constants\/\">[Lesson 9]<\/a><\/h4>\n<p>In our daily life, we have to deal with many kinds of information and data . For example, we need to handle data like names, money, phone number, addresses, date, stock quotes and more. Similarly, in Visual Basic 2015, we need to deal with all sorts of data, some of them can be mathematically calculated while some are in the form of text or other non-numeric forms. In Visual Basic 2015,\u00a0 we can store the data as variables, constants or arrays. The values of the variables always change, just like the contents of a mailbox or the storage bin while the value of a constant remains the same throughout.<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=\"4768455349\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h3>8.1 Visual Basic 2015 Data Types<\/h3>\n<p>Visual Basic 2015 classifies information into two major data types, \u00a0the numeric data types, and the non-numeric data type<\/p>\n<h4>8.1.1 Numeric Data Types<\/h4>\n<p>In Visual Basic 2015, numeric data types are types of data comprises numbers that can be calculated mathematically. Some examples of numeric data types are examination marks, height, body weight, the number of students in a class, share values, the price of goods, monthly bills, fees, bus fares and more.<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=\"4768455349\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><br \/>\nIn Visual Basic 2015,\u00a0 we can divide numeric data into seven types based on the range of values they can store. Calculations that only involve round figures can use Integer or Long integer. On the other hand, data\u00a0that require high precision calculation need to use single or double precision data types, they are also called floating point numbers.\u00a0 Besides that, for currency calculation, you can use the currency data types. Lastly, if even more precision is required\u00a0 we can use the decimal data types. These data types are summarized in Table 8.1<\/p>\n<h3 align=\"center\">Table 8.1: Numeric Data Types<\/h3>\n<div style=\"overflow-x:auto;\">\n<table width=\"100%\">\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><strong>8.1.2 Non-numeric Data Types<\/strong><\/h4>\n<p>In Visual Basic 2015, non-numeric data types are data that we cannot calculate them\u00a0mathematically. The non-numeric data comprises text or 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. We can summarize them 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<h3>8.1.3 Suffixes for Literals<\/h3>\n<p>Literals are values that you assign to data. In some cases, we need to add a suffix behind a literal so that Visual Basic 2015 can handle the calculations more accurately. For example, we can use num=1.3089! for a single\u00a0precision data type, num=1.3089# for a double\u00a0precision data type, num=130890&amp; to indicate long integer data type and num=1.3089@ to indicate currency data type. 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 style=\"text-align: center;\">Suffix<\/th>\n<th style=\"text-align: center;\">Data Type<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">&amp;<\/td>\n<td style=\"text-align: center;\">Long<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">!<\/td>\n<td style=\"text-align: center;\">Single<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">#<\/td>\n<td style=\"text-align: center;\">Double<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">@<\/td>\n<td style=\"text-align: center;\">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<p>memberName=&#8221;Turban, John.&#8221;<br \/>\nTelNumber=&#8221;1800-900-888-777&#8243;<br \/>\nLastDay=#31-Dec-00#<br \/>\nExpTime=#12:00 am#<\/p>\n<div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<!-- vb2015 tutorial matched content --><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block;\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"5090773108\" data-ad-format=\"autorelaxed\"><\/ins><br \/>\n<script>\n(adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div>\n<h4 style=\"text-align: center;\"><a title=\"visual basic 2015 tutorial lesson 7\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-tutorial\/\">[Lesson 7]<\/a> &lt;&lt; <a title=\"Visual Basic 2015 tutorial\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-tutorial\/\">[Contents] <\/a>&gt;&gt; <a title=\"visual basic 2015 lesson 9\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-9-working-variable-constants\/\">[Lesson 9]<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"<p>[Lesson 7] &lt;&lt; [Contents] &gt;&gt; [Lesson 9] In our daily life, we have to deal with many kinds of information and data . For example, we need to handle data like names, money, phone number, addresses, date, stock quotes and more. Similarly, in Visual Basic 2015, we need to deal with all sorts of data, &hellip; <a href=\"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-8-dealing-data\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Visual Basic 2015 Lesson 8: Dealing with 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-5974","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 2015 Lesson 8: Dealing with Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB<\/title>\n<meta name=\"description\" content=\"This article describe how to deal with data in visual basic 2015\" \/>\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\/vb2015\/vb2015_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 2015 Lesson 8: Dealing with Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"og:description\" content=\"This article describe how to deal with data in visual basic 2015\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_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-24T07:27:05+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-2015-lesson-8-dealing-data\/\",\"url\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html\",\"name\":\"Visual Basic 2015 Lesson 8: Dealing with Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/#website\"},\"datePublished\":\"2015-03-23T07:15:19+00:00\",\"dateModified\":\"2018-02-24T07:27:05+00:00\",\"description\":\"This article describe how to deal with data in visual basic 2015\",\"breadcrumb\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vbtutor.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visual Basic 2015 Lesson 8: Dealing with 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 2015 Lesson 8: Dealing with Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"This article describe how to deal with data in visual basic 2015","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\/vb2015\/vb2015_lesson8.html","og_locale":"en_US","og_type":"article","og_title":"Visual Basic 2015 Lesson 8: Dealing with Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","og_description":"This article describe how to deal with data in visual basic 2015","og_url":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_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-24T07:27:05+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-2015-lesson-8-dealing-data\/","url":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html","name":"Visual Basic 2015 Lesson 8: Dealing with Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/#website"},"datePublished":"2015-03-23T07:15:19+00:00","dateModified":"2018-02-24T07:27:05+00:00","description":"This article describe how to deal with data in visual basic 2015","breadcrumb":{"@id":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson8.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vbtutor.net\/"},{"@type":"ListItem","position":2,"name":"Visual Basic 2015 Lesson 8: Dealing with 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\/5974","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=5974"}],"version-history":[{"count":59,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/5974\/revisions"}],"predecessor-version":[{"id":12446,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/5974\/revisions\/12446"}],"wp:attachment":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/media?parent=5974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/categories?post=5974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/tags?post=5974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}