{"id":10756,"date":"2017-05-02T09:28:01","date_gmt":"2017-05-02T01:28:01","guid":{"rendered":"http:\/\/www.vbtutor.net\/?p=10756"},"modified":"2017-10-06T21:43:56","modified_gmt":"2017-10-06T13:43:56","slug":"dynamic-arrays","status":"publish","type":"post","link":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/","title":{"rendered":"Dynamic Arrays"},"content":{"rendered":"<p>Array size is often defined during design time. This type of array is known as static array. However, the problem is sometimes we might not know how many data items we need to store during run time. In this case, we need to use dynamic array where the number of elements will be decided during run time. In Visual Basic 2017, the dynamic array can be resized when the program is executing. The first step in declaring a dynamic array is by using the Dim statement without specifying the dimension list, as follows:<\/p>\n<p>Dim myArray()<\/p>\n<p>Then at run time we can specify the actual array size using the ReDim statement,as follows:<\/p>\n<p>ReDim myArray(n)<br \/>\n* n =array size<br \/>\nYou can also declare a two dimensional array using ReDim statement, as follows:<\/p>\n<p>ReDim myArray(n, m)<br \/>\n*mxn indicates the array size.<\/p>\n<p>Read more here<br \/>\n<a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-10-working-arrays\/\">http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-10-working-arrays\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Array size is often defined during design time. This type of array is known as static array. However, the problem is sometimes we might not know how many data items we need to store during run time. In this case, we need to use dynamic array where the number of elements will be decided during &hellip; <a href=\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Dynamic Arrays<\/span><\/a><\/p>\n","protected":false},"author":23013,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,1],"tags":[],"class_list":["post-10756","post","type-post","status-publish","format-standard","hentry","category-latestnews","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Dynamic Arrays - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dynamic Arrays - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"og:description\" content=\"Array size is often defined during design time. This type of array is known as static array. However, the problem is sometimes we might not know how many data items we need to store during run time. In this case, we need to use dynamic array where the number of elements will be decided during &hellip; Continue reading Dynamic Arrays\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\" \/>\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:published_time\" content=\"2017-05-02T01:28:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-10-06T13:43:56+00:00\" \/>\n<meta name=\"author\" content=\"Liew Voon Kiong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@liewvk\" \/>\n<meta name=\"twitter:site\" content=\"@liewvk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Liew Voon Kiong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\"},\"author\":{\"name\":\"Liew Voon Kiong\",\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d\"},\"headline\":\"Dynamic Arrays\",\"datePublished\":\"2017-05-02T01:28:01+00:00\",\"dateModified\":\"2017-10-06T13:43:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\"},\"wordCount\":153,\"articleSection\":[\"Latest News\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\",\"url\":\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\",\"name\":\"Dynamic Arrays - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/#website\"},\"datePublished\":\"2017-05-02T01:28:01+00:00\",\"dateModified\":\"2017-10-06T13:43:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vbtutor.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dynamic Arrays\"}]},{\"@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\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d\",\"name\":\"Liew Voon Kiong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vbtutor.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g\",\"caption\":\"Liew Voon Kiong\"},\"url\":\"https:\/\/www.vbtutor.net\/index.php\/author\/ajt7051vbt\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dynamic Arrays - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","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":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/","og_locale":"en_US","og_type":"article","og_title":"Dynamic Arrays - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","og_description":"Array size is often defined during design time. This type of array is known as static array. However, the problem is sometimes we might not know how many data items we need to store during run time. In this case, we need to use dynamic array where the number of elements will be decided during &hellip; Continue reading Dynamic Arrays","og_url":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/","og_site_name":"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","article_publisher":"https:\/\/www.facebook.com\/Vbtutor","article_published_time":"2017-05-02T01:28:01+00:00","article_modified_time":"2017-10-06T13:43:56+00:00","author":"Liew Voon Kiong","twitter_card":"summary_large_image","twitter_creator":"@liewvk","twitter_site":"@liewvk","twitter_misc":{"Written by":"Liew Voon Kiong","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/#article","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/"},"author":{"name":"Liew Voon Kiong","@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d"},"headline":"Dynamic Arrays","datePublished":"2017-05-02T01:28:01+00:00","dateModified":"2017-10-06T13:43:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/"},"wordCount":153,"articleSection":["Latest News"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/","url":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/","name":"Dynamic Arrays - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/#website"},"datePublished":"2017-05-02T01:28:01+00:00","dateModified":"2017-10-06T13:43:56+00:00","author":{"@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d"},"breadcrumb":{"@id":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vbtutor.net\/index.php\/2017\/05\/02\/dynamic-arrays\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vbtutor.net\/"},{"@type":"ListItem","position":2,"name":"Dynamic Arrays"}]},{"@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"},{"@type":"Person","@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/01c0e3de22b7692f291440df0ef6601d","name":"Liew Voon Kiong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vbtutor.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/298e9b7c976f23b8bb0deac1079900704b531945d53dab6cda022294a3dda3d4?s=96&d=identicon&r=g","caption":"Liew Voon Kiong"},"url":"https:\/\/www.vbtutor.net\/index.php\/author\/ajt7051vbt\/"}]}},"_links":{"self":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts\/10756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"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=10756"}],"version-history":[{"count":2,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts\/10756\/revisions"}],"predecessor-version":[{"id":10758,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/posts\/10756\/revisions\/10758"}],"wp:attachment":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/media?parent=10756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/categories?post=10756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/tags?post=10756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}