SlideShare a Scribd company logo
User define data type In Visual Basic
User-Defined Data Types in Visual Basic 6
 Variables of different data types when combined as a single
variable to hold several related informations is called a User-
Defined data type.
 A Type statement is used to define a user-defined type in the
General declaration section of a form or module.
 User-defined data types can only be private in form while in
standard modules can be public or private.
 An example for a user defined data type to hold the product
details is as given below.
 Private Type ProductDetails
ProdID as String
ProdName as String
Price as Currency
End Type
 The user defined data type can be declared with a variable
using the Dim statement as in any other variable declaration
statement. An array of these user-defined data types can
also be declared.
 An example to consolidate these two features is given
below.
 Dim ElectronicGoods as ProductDetails ' One Record
Dim ElectronicGoods(10) as ProductDetails ' An array of 11
records
 A User-Defined data type can be referenced in an application by
using the variable name in the procedure along with the item
name in the Type block. Say, for example if the text property of a
TextBox namely text1 is to be assigned the name of the electronic
good, the statement can be written as given below.
 Text1.Text = ElectronicGoods.ProdName
 If the same is implemented as an array, then the statement
becomes
 Text1.Text = ElectronicGoods(i).ProdName
 User-defined data types can also be passed to procedures to allow
many related items as one argument.
 Sub ProdData( ElectronicGoods as ProductDetails)
Text1.Text = ElectronicGoods.ProdName
Text1.Text = ElectronicGoods.Price
End Sub
With statement
 When properties are set for objects or methods are called, a lot of
coding is included that acts on the same object. It is easier to read
the code by implementing the With...End With statement.
 Multiple properties can be set and multiple methods can be called
by using the With...End With statement. The code is executed
more quickly and efficiently as the object is evaluated only once.
The concept can be clearly understood with following example.
 With Text1
.Font.Size = 14
.Font.Bold = True
.ForeColor = vbRed
.Height = 230
.Text = "Hello World"
End With
 In the above coding, the object Text1, which is a text box is evaluated only once instead of
every associated property or method. This makes the coding simpler and efficient.
User define data type In Visual Basic
Ad

More Related Content

What's hot (20)

Java layoutmanager
Java layoutmanagerJava layoutmanager
Java layoutmanager
Arati Gadgil
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
kalyanineve
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
Data types vbnet
Data types vbnetData types vbnet
Data types vbnet
nicky_walters
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
Jaya Kumari
 
Html frames
Html framesHtml frames
Html frames
ManishaSheelam
 
Indexing structure for files
Indexing structure for filesIndexing structure for files
Indexing structure for files
Zainab Almugbel
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
Boopathi K
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
Archit Saxena
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
DBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCLDBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCL
Sreedhar Chowdam
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
Jaya Kumari
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
ramyaaswin
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR
 
Android Layout.pptx
Android Layout.pptxAndroid Layout.pptx
Android Layout.pptx
vishal choudhary
 
Database users
Database usersDatabase users
Database users
Param Radadiya
 
OOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependencyOOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependency
Mudasir Qazi
 
File system vs DBMS
File system vs DBMSFile system vs DBMS
File system vs DBMS
BHARATH KUMAR
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
kuldeep100
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
sonalikharade3
 
Java layoutmanager
Java layoutmanagerJava layoutmanager
Java layoutmanager
Arati Gadgil
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
kalyanineve
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
Jaya Kumari
 
Indexing structure for files
Indexing structure for filesIndexing structure for files
Indexing structure for files
Zainab Almugbel
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
Boopathi K
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
Archit Saxena
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
Jaya Kumari
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
ramyaaswin
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR
 
OOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependencyOOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependency
Mudasir Qazi
 

Viewers also liked (6)

Business Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution PatternsBusiness Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution Patterns
Pooyan Jamshidi
 
Data types
Data typesData types
Data types
Syed Umair
 
N-Tier, Layered Design, SOA
N-Tier, Layered Design, SOAN-Tier, Layered Design, SOA
N-Tier, Layered Design, SOA
Sperasoft
 
N-Tier Application Architecture
N-Tier Application ArchitectureN-Tier Application Architecture
N-Tier Application Architecture
Manoj Kumar
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
guestd0cc01
 
3 Tier Architecture
3  Tier Architecture3  Tier Architecture
3 Tier Architecture
Webx
 
Business Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution PatternsBusiness Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution Patterns
Pooyan Jamshidi
 
N-Tier, Layered Design, SOA
N-Tier, Layered Design, SOAN-Tier, Layered Design, SOA
N-Tier, Layered Design, SOA
Sperasoft
 
N-Tier Application Architecture
N-Tier Application ArchitectureN-Tier Application Architecture
N-Tier Application Architecture
Manoj Kumar
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
guestd0cc01
 
3 Tier Architecture
3  Tier Architecture3  Tier Architecture
3 Tier Architecture
Webx
 
Ad

Similar to User define data type In Visual Basic (20)

Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Prabu U
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2
Isham Rashik
 
Sharbani bhattacharya VB Structures
Sharbani bhattacharya VB StructuresSharbani bhattacharya VB Structures
Sharbani bhattacharya VB Structures
Sharbani Bhattacharya
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
Sangeetha Sg
 
I x scripting
I x scriptingI x scripting
I x scripting
Alex do Amaral Dias
 
Oop
OopOop
Oop
FatimaYousif11
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS
koolkampus
 
Introduction to Visual Basic
Introduction to Visual Basic Introduction to Visual Basic
Introduction to Visual Basic
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptxchapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
AmrutaNavale2
 
DDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdfDDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdf
Eleonora Ciceri
 
Classes and objects object oriented programming
Classes and objects object oriented programmingClasses and objects object oriented programming
Classes and objects object oriented programming
areebakanwal12
 
Basics of Xml
Basics of XmlBasics of Xml
Basics of Xml
Jerry Kurian
 
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
jorgeulises3
 
APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...
APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...
APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...
cscpconf
 
Apply hibernate to model and persist associations mappings in document versio...
Apply hibernate to model and persist associations mappings in document versio...Apply hibernate to model and persist associations mappings in document versio...
Apply hibernate to model and persist associations mappings in document versio...
csandit
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
LakshmiSarvani6
 
object oriented fundamentals in vb.net
object oriented fundamentals in vb.netobject oriented fundamentals in vb.net
object oriented fundamentals in vb.net
bantamlak dejene
 
Variables and calculations_chpt_4
Variables and calculations_chpt_4Variables and calculations_chpt_4
Variables and calculations_chpt_4
cmontanez
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
bantamlak dejene
 
Data structures basics
Data structures basicsData structures basics
Data structures basics
maamir farooq
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Prabu U
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2
Isham Rashik
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
Sangeetha Sg
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS
koolkampus
 
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptxchapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
AmrutaNavale2
 
DDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdfDDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdf
Eleonora Ciceri
 
Classes and objects object oriented programming
Classes and objects object oriented programmingClasses and objects object oriented programming
Classes and objects object oriented programming
areebakanwal12
 
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
jorgeulises3
 
APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...
APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...
APPLY HIBERNATE TO MODEL AND PERSIST ASSOCIATIONS MAPPINGS IN DOCUMENT VERSIO...
cscpconf
 
Apply hibernate to model and persist associations mappings in document versio...
Apply hibernate to model and persist associations mappings in document versio...Apply hibernate to model and persist associations mappings in document versio...
Apply hibernate to model and persist associations mappings in document versio...
csandit
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
LakshmiSarvani6
 
object oriented fundamentals in vb.net
object oriented fundamentals in vb.netobject oriented fundamentals in vb.net
object oriented fundamentals in vb.net
bantamlak dejene
 
Variables and calculations_chpt_4
Variables and calculations_chpt_4Variables and calculations_chpt_4
Variables and calculations_chpt_4
cmontanez
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
bantamlak dejene
 
Data structures basics
Data structures basicsData structures basics
Data structures basics
maamir farooq
 
Ad

More from Shubham Dwivedi (6)

Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
PL SQL Quiz | PL SQL Examples
PL SQL Quiz |  PL SQL ExamplesPL SQL Quiz |  PL SQL Examples
PL SQL Quiz | PL SQL Examples
Shubham Dwivedi
 
Spectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | NetworkingSpectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | Networking
Shubham Dwivedi
 
Merge sort algorithm
Merge sort algorithmMerge sort algorithm
Merge sort algorithm
Shubham Dwivedi
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
Shubham Dwivedi
 
Internet address
Internet addressInternet address
Internet address
Shubham Dwivedi
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
PL SQL Quiz | PL SQL Examples
PL SQL Quiz |  PL SQL ExamplesPL SQL Quiz |  PL SQL Examples
PL SQL Quiz | PL SQL Examples
Shubham Dwivedi
 
Spectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | NetworkingSpectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | Networking
Shubham Dwivedi
 

Recently uploaded (20)

Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025
fs4635986
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
Imma Valls Bernaus
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025
fs4635986
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
Imma Valls Bernaus
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 

User define data type In Visual Basic

  • 2. User-Defined Data Types in Visual Basic 6  Variables of different data types when combined as a single variable to hold several related informations is called a User- Defined data type.  A Type statement is used to define a user-defined type in the General declaration section of a form or module.  User-defined data types can only be private in form while in standard modules can be public or private.  An example for a user defined data type to hold the product details is as given below.  Private Type ProductDetails ProdID as String ProdName as String Price as Currency End Type
  • 3.  The user defined data type can be declared with a variable using the Dim statement as in any other variable declaration statement. An array of these user-defined data types can also be declared.  An example to consolidate these two features is given below.  Dim ElectronicGoods as ProductDetails ' One Record Dim ElectronicGoods(10) as ProductDetails ' An array of 11 records
  • 4.  A User-Defined data type can be referenced in an application by using the variable name in the procedure along with the item name in the Type block. Say, for example if the text property of a TextBox namely text1 is to be assigned the name of the electronic good, the statement can be written as given below.  Text1.Text = ElectronicGoods.ProdName  If the same is implemented as an array, then the statement becomes  Text1.Text = ElectronicGoods(i).ProdName  User-defined data types can also be passed to procedures to allow many related items as one argument.  Sub ProdData( ElectronicGoods as ProductDetails) Text1.Text = ElectronicGoods.ProdName Text1.Text = ElectronicGoods.Price End Sub
  • 5. With statement  When properties are set for objects or methods are called, a lot of coding is included that acts on the same object. It is easier to read the code by implementing the With...End With statement.  Multiple properties can be set and multiple methods can be called by using the With...End With statement. The code is executed more quickly and efficiently as the object is evaluated only once. The concept can be clearly understood with following example.  With Text1 .Font.Size = 14 .Font.Bold = True .ForeColor = vbRed .Height = 230 .Text = "Hello World" End With  In the above coding, the object Text1, which is a text box is evaluated only once instead of every associated property or method. This makes the coding simpler and efficient.