In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to use Type in VB.NET, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
We must all know about the data type of VB.NET, but it is still a difficulty for beginners. In fact, in the simplest program, the data type can not be specified, that is, variables can use various types, but in a complex program, it is very dangerous to do so, because it is likely to give the same variable a different type, which leads to program error.
Therefore, for the sake of program rigor and ease of viewing, it is necessary to define data types correctly. Another reason for defining data is that different data takes up different amounts of memory. For example, Interger data takes 2 bytes, while long integer data takes 4 bytes. Define the appropriate data type, whether you believe it or not, it can save memory! The VB.NET record definition is a method of handing control to the user. It allows the user to define their own data type. The VB.NET record definition uses the keyword "Type" by:
Type [data Type Identifier] As End Type
For example, a VB.NET record defines an address data:
Type Address Street As String ZipCode As String Phone As String End Type
This address data includes three attributes, block, zip code, and phone number, which can be defined as this type of data:
Dim MyHome As Address
When you want to call or change the value of "MyHome", it is similar to the operation on the properties of the object:
Variable name. Domain name = "."
To simplify the repetition of writing, you can use the keyword "With":
With MyHome. Street = "Fucheng Road" .ZipCode = "100037" .Phone = "12345678" End With Thank you for reading this article carefully. I hope the article "how to use Type in VB.NET" shared by the editor will be helpful to you. At the same time, I hope you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.